mirror of
https://github.com/Xaymar/obs-StreamFX
synced 2024-11-10 22:05:06 +00:00
util-event: Automatically clear event listeners when destructed
This commit is contained in:
parent
8e9e39a88e
commit
1b7de8b6b1
1 changed files with 7 additions and 0 deletions
|
@ -30,6 +30,13 @@ namespace util {
|
|||
std::function<void()> silence_cb;
|
||||
|
||||
public /* functions */:
|
||||
|
||||
// Destructor
|
||||
inline ~event()
|
||||
{
|
||||
this->clear();
|
||||
}
|
||||
|
||||
// Add new listener.
|
||||
inline void add(std::function<void(_args...)> listener)
|
||||
{
|
||||
|
|
Loading…
Reference in a new issue