[svn.haxx.se] · SVN Dev · SVN Users · SVN Org · TSVN Dev · TSVN Users · Subclipse Dev · Subclipse Users · this month's index

Strange pattern with a dangling pointer in TProc

From: Dmitry <wipedout_at_yandex.ru>
Date: Tue, 23 Nov 2010 12:14:43 +0300

Hey.

Almost any class implementing a Tortoise Proc "user command" has a pattern like the following:

void CClass::Execute()
{
   CSVNProgressDlg progDlg;
   theApp.m_pMainWnd = &progDlg;
// create dialog, run modal loop, exit
}

When the function exits the dialog object is destroyed, but m_pMainWnd in the global object is kept unchanged and now stores a dangling pointer. Is there any reason for that? If not - I could send in a fix.

Best wishes.
Dmitry.

------------------------------------------------------
http://tortoisesvn.tigris.org/ds/viewMessage.do?dsForumId=757&dsMessageId=2685026

To unsubscribe from this discussion, e-mail: [dev-unsubscribe_at_tortoisesvn.tigris.org].
Received on 2010-11-23 10:14:53 CET

This is an archived mail posted to the TortoiseSVN Dev mailing list.

This site is subject to the Apache Privacy Policy and the Apache Public Forum Archive Policy.