While connected to a non-virtual MIDI device on Mac OS X, when rewinding to a point before the connection I get the following error messages:
Failed to dispose of MIDI port (-50)
Failed to dispose of MIDI client (-50)
Steps to reproduce:
In this scenario I also get an odd situation in the debugger sometimes, where if I step back after a breakpoint was triggered, the openMSX screen goes black and it stops working. It is consistent for certain breakpoints which are triggered by a MIDI message (could be that some additional MIDI messages are sent after it), but does not generally happen when I break the emulation randomly and step back. I suspect the source of this problem is the same.
<wouterv> not 100% sure yet, but it seems both MidiInWindows and MidiInCoreMidi don't correctly restore on loadstate .. they should check whether they were plugged and redo the stuff done in plughelper() (e.g. see input/Joystick.cc : serialize())</wouterv>
<wouterv> the following might explain the problem: currently loadstate doesn't correctly restore MidiInCoreMidi: isPlugged() is true, but the invariants established in PlugHelper() don't hold .. e.g. 'client' is not initialized</wouterv>
<wouterv> when later such a machine is destroyed unplugHelper() is called and that uses the unitialized 'client' variable</wouterv>
<wouterv> and that prints (hopefully) the Failed to dispose of MIDI client message</wouterv>