Hello,
I was implementing it, but I noticed a strange thing.
Here:

https://github.com/FluidSynth/fluidsynth/blob/master/src/fluidsynth.c#L693

there is a piece of code that it is not emitted for MACOS.
And here:

https://github.com/FluidSynth/fluidsynth/blob/master/src/fluidsynth.c#L738

for some unknown reason (bug?), those network resources are not release also on 
WIN32.
So, I tried to remove WIN32 from that #ifdef.
Result: crash on quit.
After some debugging, I have seen that delete_fluid_server_socket():

https://github.com/FluidSynth/fluidsynth/blob/master/src/utils/fluid_sys.c#L1155

is closing the socket and then it frees 'server_socket' before the thread could 
reach this line:

https://github.com/FluidSynth/fluidsynth/blob/master/src/utils/fluid_sys.c#L1035

so an exception is raised as soon as 'server_socket->cont' is executed in the 
thread.
I was able to solve it by adding:

fluid_thread_join(server_socket->thread);

into delete_fluid_server_socket().
Actually, here:

https://github.com/FluidSynth/fluidsynth/blob/master/src/fluidsynth.c#L742

there is a call to join, but it seems to me it is expected to work for a 
different purpose that I cannot understand very well, actually FluidSynth never 
exits when "-i" and "-s" options are both specified and I have to kill it with 
the TaskManager.

Since that code was commented with an #ifdef on WIN32, it was not possible to 
see the crash before, although I do not understand very well why it was not 
visible on other platforms (luck?).

Sincerely.



> Il 8 dicembre 2017 alle 14.52 "Tom M." <tom.m...@googlemail.com> ha scritto:
> 
> > In my opinion, the network support should be a feature, not a requirement 
> > and FluidSynth is a synthesizer,
> 
> Ok then, I dont mind if we make this feature optional. In fact there already 
> is a WITHOUT_SERVER macro for MacOSX. You could start from there, however 
> this macro should then be called NETWORK_SUPPORT. And we would need a dummy 
> implementation of new_fluid_server() in order to not break ABI.
> 
> Could you file a PR?
> 
> Tom
> 
> _______________________________________________
> fluid-dev mailing list
> fluid-dev@nongnu.org
> https://lists.nongnu.org/mailman/listinfo/fluid-dev

_______________________________________________
fluid-dev mailing list
fluid-dev@nongnu.org
https://lists.nongnu.org/mailman/listinfo/fluid-dev

Reply via email to