x11: Unload effects before destroying Workspace and Compositor
Effects can hold references to closed windows, which can cause problems after the workspace is destroyed. This change makes ApplicationX11 unload effects before destroying the Workspace and the Compositor similar to how it's done in main_wayland. BUG: 475511
This commit is contained in:
parent
75304afe0f
commit
aabc162632
1 changed files with 9 additions and 0 deletions
|
@ -17,6 +17,7 @@
|
|||
#include "core/outputbackend.h"
|
||||
#include "core/session.h"
|
||||
#include "cursor.h"
|
||||
#include "effects.h"
|
||||
#include "outline.h"
|
||||
#include "screenedge.h"
|
||||
#include "sm.h"
|
||||
|
@ -181,6 +182,10 @@ ApplicationX11::ApplicationX11(int &argc, char **argv)
|
|||
ApplicationX11::~ApplicationX11()
|
||||
{
|
||||
setTerminating();
|
||||
// need to unload all effects before destroying Workspace, as effects might call into Workspace
|
||||
if (effects) {
|
||||
static_cast<EffectsHandlerImpl *>(effects)->unloadAllEffects();
|
||||
}
|
||||
destroyPlugins();
|
||||
destroyColorManager();
|
||||
destroyWorkspace();
|
||||
|
@ -238,6 +243,10 @@ PlatformCursorImage ApplicationX11::cursorImage() const
|
|||
void ApplicationX11::lostSelection()
|
||||
{
|
||||
sendPostedEvents();
|
||||
// need to unload all effects before destroying Workspace, as effects might call into Workspace
|
||||
if (effects) {
|
||||
static_cast<EffectsHandlerImpl *>(effects)->unloadAllEffects();
|
||||
}
|
||||
destroyPlugins();
|
||||
destroyColorManager();
|
||||
destroyWorkspace();
|
||||
|
|
Loading…
Reference in a new issue