[mythtv] MythDialogBox memory management
Nigel Pearson
nigel at ind.tansu.com.au
Fri Aug 15 06:27:08 UTC 2008
Had some interesting problems deleting
a MythDialogBox after it has been used.
1) Can't do it in an event filter when we get the
DialogCompletionEvent, because the object is the
thing that sent the DCE (in MythDialogBox::SendEvent)
2) Tried to do it next time I had to create the Dialog:
MythMainWindow *win = gContext->GetMainWindow();
MythScreenStack *stk = win->GetStack("popup stack");
if (m_popup) // Previous dialog should be long gone?
m_popup->deleteLater();
m_popup = new MythDialogBox(label, stk, "select drive");
which did:
QCoreApplication::postEvent: Receiver is not a valid QObject
on the deleteLater(), or:
Program received signal EXC_BAD_ACCESS, Could not access memory.
Reason: KERN_INVALID_ADDRESS at address: 0x7400001e
0x7400001e in ?? ()
(gdb) where
#0 0x7400001e in ?? ()
#1 0xc605e2da in MediaMonitor::selectDrivePopup (this=0x1a99cc70,
label=@0xbfffe02c, resultID=@0xbfffe028, showMounted=true) at
mythmediamonitor.cpp:173
if I swap it with a delete.
So, after poking around in mythscreenstack.cpp,
am I right in assuming that things are deleted
after they remove themselves from a stack?
Are there times/reasons when thingies do need
explicit memory management like I was attempting?
--
Nigel Pearson, nigel at ind.tansu.com.au|"Gentlemen,
Telstra Net. Eng., Sydney, Australia | you can't fight in here-
Office: 9202 3900 Fax: 9261 3912 | this is the war room!"
Mobile: 0408 664435 Home: 9792 6998 | Dr Strangelove
More information about the mythtv-dev
mailing list