+ Reply to Thread
Results 1 to 2 of 2

Thread: Calling delete this in destructor

  1. #1

    Calling delete this in destructor

    Calling delete 'this' in destructor

  2. #2
    This will make your stack full and stack overflow exception will raise.

    Example:
    Code:
    class CDeleteThis
    {
    public:
    	CDeleteThis()
    	{
    	}
    
    	~CDeleteThis()
    	{
    		delete this ;
    	}
    } ;
    This is like infinite loop.

+ Reply to Thread

Bookmarks

Posting Permissions

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