Merge pull request #4938 from jayshozie/hyprland/window/segfault-fix
fix(hyprland/window): Fix segfault caused by use-after-free
This commit is contained in:
@@ -19,20 +19,19 @@ std::shared_mutex windowIpcSmtx;
|
||||
|
||||
Window::Window(const std::string& id, const Bar& bar, const Json::Value& config)
|
||||
: AAppIconLabel(config, "window", id, "{title}", 0, true), bar_(bar), m_ipc(IPC::inst()) {
|
||||
std::unique_lock<std::shared_mutex> windowIpcUniqueLock(windowIpcSmtx);
|
||||
|
||||
separateOutputs_ = config["separate-outputs"].asBool();
|
||||
|
||||
update();
|
||||
|
||||
// register for hyprland ipc
|
||||
std::unique_lock<std::shared_mutex> windowIpcUniqueLock(windowIpcSmtx);
|
||||
m_ipc.registerForIPC("activewindow", this);
|
||||
m_ipc.registerForIPC("closewindow", this);
|
||||
m_ipc.registerForIPC("movewindow", this);
|
||||
m_ipc.registerForIPC("changefloatingmode", this);
|
||||
m_ipc.registerForIPC("fullscreen", this);
|
||||
|
||||
windowIpcUniqueLock.unlock();
|
||||
|
||||
update();
|
||||
dp.emit();
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user