I am looking at some code similar to this. I have theories as to
why the destructor is never called. In my opinion, the dialog does go
out of scope...the manager object should automatically delete it.
In the dialog, based on some query results certain controls are disabled.Code:void ShowSearchDialog(void) { uniqe_ptr<CModeLess> m_pmodeless(new CModeLess(this)); m_pmodeless->Create(CModeLess::IDD); m_pmodeless->ShowWindow(SW_SHOW); }
The next time the function is called the same controls are disabled even
if the query did not return the state that causes the controls to be disabled
again.
#1 Why doesn't the destructor get called?
#2 Why is the object hanging around?
#3 Why does the same object appear to be
reconnecting to the pointer on subsequent calls?![]()





Reply With Quote
