One might argue that the port is not closed until this message is received, and
that the destruction of the critical section should not happen until this
message is received, but this might not fit the abstracted architecture.

Elsewise, I would move the Enter/Leave into the case statements that actually
need them (MIM_DATA and MIM_LONGDATA), instead of making a special case for one
message.

-cpr

Quoting Julien Pommier <[EMAIL PROTECTED]>:

> Hi there,
> 
> I have spent some time tracking a crash occuring with "Virtual Midi 
> Controller" ( http://www.soundcosoftware.com/vmc.htm )
> Apparently, this virtual midi device is still calling the callback 
> (once) after the stream has been closed, so I am not sure if portmidi is 
> really the one to blame. The callback is called with wMsg==MIM_CLOSE , 
> and it causes a crash because the callback is protected by a critical 
> section which have been destroyed.
> 
> So I suggest patching winmm_in_callback with a "if (wMsg == MIM_CLOSE) 
> return;" placed before the EnterCriticalSection code. At least it seems 
> to work well here :)
> 
> btw, about pm_dll.dll : I don't use it in our host, and so far I have 
> never experienced/heard of windows crashes so I would say it can safely 
> be omitted, at least for winxp and vista.
> 
> Best regards,
> Julien Pommier.
> _______________________________________________
> media_api mailing list
> [email protected]
> http://www.create.ucsb.edu/mailman/listinfo/media_api
> 




----------------------------------------------------------------
This message was sent using IMP, the Internet Messaging Program.

_______________________________________________
media_api mailing list
[email protected]
http://www.create.ucsb.edu/mailman/listinfo/media_api

Reply via email to