mirror of
https://github.com/AyuGram/AyuGramDesktop.git
synced 2025-06-07 07:33:52 +02:00
Correctly destroy Media::Capture::Inner.
This commit is contained in:
parent
4cea79973f
commit
b9685ec711
1 changed files with 6 additions and 2 deletions
|
@ -130,8 +130,12 @@ void Instance::check() {
|
||||||
}
|
}
|
||||||
|
|
||||||
Instance::~Instance() {
|
Instance::~Instance() {
|
||||||
InvokeQueued(_inner.get(), [copy = base::take(_inner)] {
|
// Send _inner to it's thread for destruction.
|
||||||
});
|
if (const auto context = _inner.get()) {
|
||||||
|
InvokeQueued(context, [copy = base::take(_inner)]{});
|
||||||
|
}
|
||||||
|
|
||||||
|
// And wait for it to finish.
|
||||||
_thread.quit();
|
_thread.quit();
|
||||||
_thread.wait();
|
_thread.wait();
|
||||||
}
|
}
|
||||||
|
|
Loading…
Add table
Reference in a new issue