Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix: app crashed when window destroyed in quick #261

Merged
merged 2 commits into from
Dec 2, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 5 additions & 5 deletions src/vtablehook.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -185,15 +185,15 @@ void VtableHook::autoCleanVtable(const void *obj)
if (!fun)
return;

typedef void(*Destruct)(const void*);
Destruct destruct = reinterpret_cast<Destruct>(fun);
// call origin destruct function
destruct(obj);

if (hasVtable(obj)) {// 需要判断一下,有可能在执行析构函数时虚表已经被删除
// clean
clearGhostVtable(obj);
}

typedef void(*Destruct)(const void*);
Destruct destruct = reinterpret_cast<Destruct>(fun);
// call origin destruct function
destruct(obj);
}

bool VtableHook::ensureVtable(const void *obj, std::function<void ()> destoryObjFun)
Expand Down
4 changes: 0 additions & 4 deletions xcb/dnotitlebarwindowhelper.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -81,10 +81,6 @@ DNoTitlebarWindowHelper::~DNoTitlebarWindowHelper()
{
g_pressPoint.remove(this);

if (VtableHook::hasVtable(m_window)) {
VtableHook::resetVtable(m_window);
}

mapped.remove(qobject_cast<QWindow*>(parent()));

if (m_window->handle()) { // 当本地窗口还存在时,移除设置过的窗口属性
Expand Down