-
Notifications
You must be signed in to change notification settings - Fork 15
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Fix for #42 #44
Fix for #42 #44
Conversation
Guard against null _plugin within PluginHost::setParentWindow Follow error convention in source code Tested arch: arm64 Confirm no longer crash
As a matter of style, you could assert that the plugin isn't null, and if it is return without logging. |
For sure, however you'd most like code style I'll happily follow :) Running clap-host outside of a debug environment e.g. direct from terminal does mean logging is seen. In previous companies we tend to lean towards asserts with logging, to allow the debugger to break for those running and also logging for QA to include in reports. I'll push another commit with assert later today, cheers Alexandre! And cheers for allowing contribution to the project! |
Had a play with the following: assert(_plugin);
if(!_plugin)
return; However, when the assert is hit it will trigger a SIGABRT. Ideally we have a cross platform msvc DebugBreak() equivalent which I believe C++26 will introduce: For now I'd suggest we keep the original commit with no assert to avoid crashes. Cheers :) |
I think we should rather look for the cause of the problem. I mean inside of
... same actually goes for the check in #40 and the menu entry "Load Native Plugin Preset"! |
Agreed yep, ideally the menu entry is disabled so both the user knows this is not a possible action, and the code is not executed Great shout |
Fix for #42
Guard against null _plugin within PluginHost::setParentWindow
Follow error convention in source code
Tested arch: arm64
Confirm no longer crash