From bbb6f7dacdf62f99764b519db899e77112e3dffc Mon Sep 17 00:00:00 2001 From: cxl Date: Sat, 21 Feb 2015 17:53:19 +0000 Subject: [PATCH] Fixed heap leaks issue with KDE #988 git-svn-id: svn://ultimatepp.org/upp/trunk@8191 f0d560ea-af0d-0410-9eb7-867de7ffcac7 --- uppsrc/CtrlCore/GtkApp.cpp | 8 +++++++- uppsrc/CtrlCore/GtkCreate.cpp | 1 + uppsrc/CtrlCore/init | 2 +- 3 files changed, 9 insertions(+), 2 deletions(-) diff --git a/uppsrc/CtrlCore/GtkApp.cpp b/uppsrc/CtrlCore/GtkApp.cpp index 704e3431e..03d48a886 100644 --- a/uppsrc/CtrlCore/GtkApp.cpp +++ b/uppsrc/CtrlCore/GtkApp.cpp @@ -26,8 +26,14 @@ void _DBG_Ungrab(void) void Ctrl::PanicMsgBox(const char *title, const char *text) { LLOG("PanicMsgBox " << title << ": " << text); + if(system("which gxmessage") == 0) + IGNORE_RESULT(system(String().Cat() << "gxmessage -center \"" << title << "\n" << text << "\"")); + else + if(system("which kdialog") == 0) + IGNORE_RESULT(system(String().Cat() << "kdialog --error \"" << title << "\n" << text << "\"")); + else if(system("which xmessage") == 0) - system(String().Cat() << "xmessage -center \"" << title << "\n" << text << "\""); + IGNORE_RESULT(system(String().Cat() << "xmessage -center \"" << title << "\n" << text << "\"")); else { _DBG_Ungrab(); GtkWidget *dialog = gtk_message_dialog_new(NULL, GTK_DIALOG_MODAL, GTK_MESSAGE_ERROR, diff --git a/uppsrc/CtrlCore/GtkCreate.cpp b/uppsrc/CtrlCore/GtkCreate.cpp index eb355744e..2c9db42e0 100644 --- a/uppsrc/CtrlCore/GtkCreate.cpp +++ b/uppsrc/CtrlCore/GtkCreate.cpp @@ -8,6 +8,7 @@ NAMESPACE_UPP void Ctrl::Create(Ctrl *owner, bool popup) { + MemoryIgnoreLeaksBlock ___; GuiLock __; ASSERT_(IsMainThread(), "Only the main thread can open a window"); LLOG("Create " << Name() << " " << GetRect()); diff --git a/uppsrc/CtrlCore/init b/uppsrc/CtrlCore/init index 27c33a181..aa63470cf 100644 --- a/uppsrc/CtrlCore/init +++ b/uppsrc/CtrlCore/init @@ -3,7 +3,7 @@ #include "Draw/init" #include "plugin\bmp/init" #include "RichText/init" -#define BLITZ_INDEX__ Fe2ff541f9bb9f4ad3f5bcc23a34e1b73 +#define BLITZ_INDEX__ F656a4ea94e4f808b1ec63034b0e6c5ac #include "CtrlCore.icpp" #undef BLITZ_INDEX__ #endif