mirror of
https://github.com/Xaymar/obs-StreamFX
synced 2024-11-28 06:13:01 +00:00
gfx-source-texture: Release child source if add_active_child fails
This commit is contained in:
parent
10c0081f32
commit
97bf38633b
1 changed files with 3 additions and 2 deletions
|
@ -57,6 +57,7 @@ gfx::source_texture::source_texture(const char* _name, obs_source_t* _parent) :
|
||||||
throw std::invalid_argument("source does not exist");
|
throw std::invalid_argument("source does not exist");
|
||||||
}
|
}
|
||||||
if (!obs_source_add_active_child(_parent, source)) {
|
if (!obs_source_add_active_child(_parent, source)) {
|
||||||
|
obs_source_release(source);
|
||||||
throw std::runtime_error("parent is contained in child");
|
throw std::runtime_error("parent is contained in child");
|
||||||
}
|
}
|
||||||
child = std::make_unique<obs::source>(source, true, true);
|
child = std::make_unique<obs::source>(source, true, true);
|
||||||
|
|
Loading…
Reference in a new issue