mirror of
https://github.com/AyuGram/AyuGramDesktop.git
synced 2025-06-05 22:54:01 +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() {
|
||||
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.wait();
|
||||
}
|
||||
|
|
Loading…
Add table
Reference in a new issue