Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 8575537
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 11, 20262026-06-11T19:43:00+00:00 2026-06-11T19:43:00+00:00

Is it possible to register an Interface with the RegisterExpectedMemoryLeak procedure? I have a

  • 0

Is it possible to register an Interface with the RegisterExpectedMemoryLeak procedure?

I have a private field declared as:

FDragDropTarget: IDropTarget;

I then create an instance of this and attempt to Register a known memory leak for this object:

  FDragDropTarget := TDropTarget.Create(lcMain.Handle, FDragDrop);
  RegisterExpectedMemoryLeak(FDragDropTarget);

However I get a compiler error stating that there is Incompatible types: ‘Pointer’ and ‘IDropTarget’. To me, my interface instance is a pointer anyway?

So can I do this? It’s being reported via the ReportMemoryLeaksOnShutdown := True statement I have in my .dpr file.

begin
  ReportMemoryLeaksOnShutdown := True;
  Application.Initialize;
  Application.MainFormOnTaskbar := True;
  Application.CreateForm(TForm2, Form2);
  Application.Run;
end.

TDropTarget is my implementation of the IDropTarget interface:

  TDropTarget = class(TInterfacedObject, IDropTarget)
  ...
  end;

Thanks

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-11T19:43:01+00:00Added an answer on June 11, 2026 at 7:43 pm

    It’s not the interface that leaks, but the object implementing it. So I think that’s the one that needs to be registered:

    FDragDropTargetObj: TDropTarget;
    FDragDropTarget: DropTarget;
    
    
    FDragDropTargetObj := TDropTarget.Create(lcMain.Handle, FDragDrop); 
    FDragDropTarget := FDragDropTargetObj;
    RegisterExpectedMemoryLeak(FDragDropTargetObj);
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

In modern processors it is possible to load a register from memory and then
Is it possible to register ONE type for TWO interface in StructureMap ? Look:
I do this: https://stackoverflow.com/questions/12069002/autofac-resolve-with-and-without-named-parameter I register an interface. For the initialization a parameter is
I have already done the following: Register an instance of my Logger in unity
I have the following code: public class SomeClass { //InterfaceUpdateListener is an interface private
Is it possible to create a Joomla account outside the web interface. I want
I was wondering if its possible to have an ASP.NET AJAX custom usercontrol 'register'
Possible Duplicate: Register the Android App with C2DM so, I've been looking all over
I was wondering is it possible to register a broadcast receiver to receive two
A Castle Windsor question: Is it possible to register a class that has an

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.