Manage MIDI Devices -> Banks...  -> Import...

Pick GM.rgd for example

Hit cancel on the import options dialog, and it crashes in 
~ImportDeviceDialog()

ImportDeviceDialog::~ImportDeviceDialog()
{
...
    for (int i = 0; i < m_devices.size(); ++i) delete m_devices[i];
}

m_devices.size() == 1.  A Device is created and push_back to m_devices on line 
379 with the pointer pointing at 12345678.

The pointer is still pointing at 12345678 in the dtor, and the only other code 
I see that could possibly delete the device is in the accept() method, which 
is not firing.

The weirdest thing is I can m_devices[0]->getBanks.size() there in the dtor 
and it returns reasonable looking numbers for the different devices I've 
loaded.

So I put a look-at-me in the Device dtor to make sure it wasn't crashing in 
there, and when you delete m_devices[i] on the offending line, the Device dtor 
doesn't say look-at-me at all.  This suggests the pointer really is invalid.  
So why on earth is m_devices[0]->getBanks.size() returning something sensible?  
Random chance?

I'm pretty stumped on this one.  If nobody with better hacker ninja chops than 
I've got has time to look into this before the release, I suggest we see what 
happens if we comment that line out and make the conscious choice to leave a 
(possible?) memory leak in the place of a known crash.

If you try to delete an object and it's not there, is it really a memory leak 
at all?  But if it's not there, what the hell is deleting it?

I'm confused.  But it's also three hours past my bedtime.
-- 
D. Michael McIntyre

------------------------------------------------------------------------------
This SF.Net email is sponsored by the Verizon Developer Community
Take advantage of Verizon's best-in-class app development support
A streamlined, 14 day to market process makes app distribution fast and easy
Join now and get one step closer to millions of Verizon customers
http://p.sf.net/sfu/verizon-dev2dev 
_______________________________________________
Rosegarden-devel mailing list
Rosegarden-devel@lists.sourceforge.net - use the link below to unsubscribe
https://lists.sourceforge.net/lists/listinfo/rosegarden-devel

Reply via email to