OK, tricky little bug.  Thanks, Ted, for bringing it to my attention.

The story:

First thing I noticed in the debugger was that ChannelManager was
confused about whether it had an instrument or not.  It crashed
because it looked for the name of a deleted instrument.  But it does
check for NULL.  It finds an address.  Why isn't it NULL?

That was crazy.  Both slotLosingDevice and slotLosingInstrument set
the instrument slot NULL.  I can see they get called.
connectInstrument connects them.

That's funny, it always crashes on the metronome.  Hmmm.  Am I doing
that stuff for the metronome?  Turns out I wasn't.  Ironically, I
wrote code that does it right, but I had commented it out and used the
old code - I think I reverted it to fix another bug.

That will teach me a lesson about quick and dirty fixes.

The bug:

In MetronomeMapper, I assigned directly to ChannelManager's
m_instrument instead of thru setInstrument.  So it didn't get
connected to the signals that would have told it when it lost its
instrument.

The fix:

Use setInstrument.  Also removed friend declarations that allowed the
problem - they were needed at one point but no longer are.

The other bug uncovered:

As is traditional, this bug was hiding another bug.  IIRC that has
been here for years.  When we delete all devices and then add new
ones, no instruments sound, because no mappers are connected to
instruments.  I didn't fix that.  I did clear the m_triedToGetChannel
flag when we get a new instrument, but that's not it.

        Tom Breton (Tehom)



------------------------------------------------------------------------------
Comprehensive Server Monitoring with Site24x7.
Monitor 10 servers for $9/Month.
Get alerted through email, SMS, voice calls or mobile push notifications.
Take corrective actions from your mobile device.
http://pubads.g.doubleclick.net/gampad/clk?id=154624111&iu=/4140/ostg.clktrk
_______________________________________________
Rosegarden-devel mailing list
[email protected] - use the link below to unsubscribe
https://lists.sourceforge.net/lists/listinfo/rosegarden-devel

Reply via email to