Export Comms and Render Dialog fixes #202
Merged
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
This PR combines the comms-fixes and render-dialog-fixes branches (latter is based off the former)
Export Comms Fixes
Problem: Hang on OSX when trying to render after instantiating either an ADM Export Source or EAR Scene plugin after another EAR Scene.
Issue: It seems that an
nng_listen
on POSIX systems for a REQ-REP connection will return anNNG_EADDRINUSE
if the address is being used (as expected) but in the process it disrupts the connection already on there. No messages are delivered on that connection anymore and they don't even time out - just hang.Fix: For posix since it's all based around the filesystem, we can just do a
stat
to see if the address is in use without disturbing it.Sub-problem: "Command" addresses are not being reused once released.
Issue: Sockets not destroyed
Fix: Destroy socket in Processor destructor
Sub-problem: Reused "Command" addresses are not working after deleting and re-adding a Scene plugin
Issue: There is a
NngSelfRegister
mechanism which attempts to keep track of everything using NNG and callsnng_fini
to clear up globals once all usages are gone. If you delete the final plugin using NNG,nng_fini
is called. If you then launch a new plugin, the sockets are unresponsive.Fix: Don't bother with
NngSelfRegister
andnng_fini
- it's not necessary anyway: https://github.com/nanomsg/nng/blob/722bf4621703ef238fa81018f8c3e68bcef91354/include/nng/nng.h#L211 . I attempted to let the extension handle thenng_fini
call, but you can't guarantee destruction order of extension and plugins, so can get some nasty crashes - just keep it simple and don't usenng_fini
at all.Render Dialog Fixes
Problem: Getting a crash deep down in
free()
sometimes on windows when exiting REAPER. Long-term problem but hasn't caused any real problem since it's on exit.Issue: Came down to the overly complex singleton pattern in render dialog code.
Fix: Didn't bother figuring out why it wasn't working - just replaced with a much simpler pattern which fixed it anyway.
Problem: Tested with REAPER v6.58 and there are some new Render options not applicable to OBA. They needed disabling.
Fix: Disable options using existing control look-up code and OS API (or via SWELL) calls.