mirror of
https://github.com/Xaymar/obs-StreamFX
synced 2024-11-10 13:55:07 +00:00
filter-blur: Don't throw exceptions into C code
It is extremely problematic to throw C++ exceptions into C code, especially because C code usually does not handle C++ exceptions at all. Therefore we have to prevent any exception from leaving the function and define it as noexcept.
This commit is contained in:
parent
4ab609015c
commit
f65dfcbbf0
2 changed files with 5 additions and 3 deletions
|
@ -393,8 +393,7 @@ bool filter::blur::blur_instance::apply_mask_parameters(std::shared_ptr<gs::effe
|
|||
}
|
||||
|
||||
bool filter::blur::blur_instance::modified_properties(void*, obs_properties_t* props, obs_property* prop,
|
||||
obs_data_t* settings)
|
||||
{
|
||||
obs_data_t* settings) noexcept try {
|
||||
obs_property_t* p;
|
||||
const char* propname = obs_property_name(prop);
|
||||
const char* vtype = obs_data_get_string(settings, ST_TYPE);
|
||||
|
@ -552,6 +551,9 @@ bool filter::blur::blur_instance::modified_properties(void*, obs_properties_t* p
|
|||
}
|
||||
|
||||
return true;
|
||||
} catch (...) {
|
||||
P_LOG_ERROR("Unexpected exception in modified_properties callback.");
|
||||
return false;
|
||||
}
|
||||
|
||||
void filter::blur::blur_instance::translate_old_settings(obs_data_t* settings)
|
||||
|
|
|
@ -161,7 +161,7 @@ namespace filter {
|
|||
gs_texture_t* blurred_texture);
|
||||
|
||||
static bool modified_properties(void* ptr, obs_properties_t* props, obs_property* prop,
|
||||
obs_data_t* settings);
|
||||
obs_data_t* settings) noexcept;
|
||||
|
||||
void translate_old_settings(obs_data_t*);
|
||||
|
||||
|
|
Loading…
Reference in a new issue