CodeGuru Home VC++ / MFC / C++ .NET / C# Visual Basic VB Forums Developer.com
Results 1 to 3 of 3

Thread: Memory leak

  1. #1
    Join Date
    May 1999
    Posts
    3

    Memory leak

    Hi

    I am using the RUNTIME_CLASS macro. After the program terminate I have a memory leak in the IMPLEMENT_DYNCREATE macro of the class I have created with the RUNTIME_CLASS.
    Is there some thing else I need to do?

    The class created is derived from a CDialog.
    Header file:

    class CDBTreeDlg : public CDialog
    {
    // Construction
    public:
    DECLARE_DYNCREATE(CDBTreeDlg)
    CDBTreeDlg(CWnd* pParent = NULL); // standard constructor
    ....
    }




    CPP:

    IMPLEMENT_DYNCREATE(CDBTreeDlg, CDialog)





    --------------------------------------------
    Sascha Schantz
    Ordinox Network
    Tel 450 ) 686-2455
    Fax: ( 450 ) 686-0239
    URL: www.ordinox.com
    e-mail: [email protected]
    --------------------------------------------

  2. #2
    Join Date
    May 1999
    Location
    Texas, USA
    Posts
    568

    Re: Memory leak

    If you are using the RUNTIME_CLASS macro to create this class make sure you destroy the window yourself. Either override the OnPostNcDestroy function and call delete this, or if you call the delete function then call DestroyWindow in the destructor. If that doesn't help let me know how you are destroying the dialog box.

    Let me know,

    Wayne



  3. #3
    Join Date
    May 1999
    Posts
    3

    Re: Memory leak

    Thanks

    This as corrected the problem.

    Have a nice day.



    --------------------------------------------
    Sascha Schantz
    Ordinox Network
    Tel 450 ) 686-2455
    Fax: ( 450 ) 686-0239
    URL: www.ordinox.com
    e-mail: [email protected]
    --------------------------------------------

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  





Click Here to Expand Forum to Full Width

Featured