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

Threaded View

  1. #1
    Join Date
    Feb 2007
    Posts
    149

    [RESOLVED Thanks] when is the destructor called ?

    Quick question

    When is a destructor called ?
    Code:
          ThreadManager::~ThreadManager()
          {
                CloseHandle(m_hThread);  
          };

    Let's say this was in my code ?
    Is the destructor called if this object goes out of scope ?

    Example

    void foo()
    {
    ThreadManager t ;


    };

    Is the destructor called when the scope has ended ?
    Is there a way to call the destructor explicitly ?

    Is it just as simple as delete t;

    Thanks
    Stev
    Last edited by stephenprogrammer07; August 28th, 2007 at 02:45 AM.

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