mirror of
https://github.com/telegramdesktop/tdesktop
synced 2025-01-03 21:32:16 +00:00
Fix crash in theme applying.
This commit is contained in:
parent
7ec4d9af3e
commit
a949c5e287
@ -909,7 +909,11 @@ void KeepApplied() {
|
|||||||
if (!AreTestingTheme()) {
|
if (!AreTestingTheme()) {
|
||||||
return;
|
return;
|
||||||
} else if (instance->applying.overrideKeep) {
|
} else if (instance->applying.overrideKeep) {
|
||||||
instance->applying.overrideKeep();
|
// This callback will be destroyed while running.
|
||||||
|
// And it won't be able to safely access captures after that.
|
||||||
|
// So we save it on stack for the time while it is running.
|
||||||
|
const auto saved = base::take(instance->applying.overrideKeep);
|
||||||
|
saved();
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
const auto path = instance->applying.pathAbsolute;
|
const auto path = instance->applying.pathAbsolute;
|
||||||
|
Loading…
Reference in New Issue
Block a user