From bedd04ac5a8c2bb169dfa3b843ffc3aa7727776a Mon Sep 17 00:00:00 2001 From: Vadim Zeitlin Date: Wed, 27 Jan 1999 18:42:14 +0000 Subject: [PATCH] Harm's patch to fix a crash of wxPoem sample on termination git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@1500 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775 --- src/gtk/utilsres.cpp | 12 ++++++------ src/gtk1/utilsres.cpp | 12 ++++++------ 2 files changed, 12 insertions(+), 12 deletions(-) diff --git a/src/gtk/utilsres.cpp b/src/gtk/utilsres.cpp index d14f938bde..fe447a9b1a 100644 --- a/src/gtk/utilsres.cpp +++ b/src/gtk/utilsres.cpp @@ -249,20 +249,20 @@ bool wxGetResource(const wxString& section, const wxString& entry, char **value, wxXMergeDatabases(); XrmDatabase database; - if (file) { + if ( !file.IsEmpty() ) { char buffer[500]; // Is this right? Trying to get it to look in the user's // home directory instead of current directory -- JACS (void)GetIniFile(buffer, file); wxNode *node = (wxNode*) NULL; /* suppress egcs warning */ - node = wxTheResourceCache->Find(buffer); + node = wxTheResourceCache->Find(buffer); if (node) - { + { database = (XrmDatabase)node->Data(); - } - else - { + } + else + { database = XrmGetFileDatabase(buffer); wxLogTrace(wxTraceResAlloc, "Get: Number = %d", wxTheResourceCache->Number()); wxTheResourceCache->Append(buffer, (wxObject *)database); diff --git a/src/gtk1/utilsres.cpp b/src/gtk1/utilsres.cpp index d14f938bde..fe447a9b1a 100644 --- a/src/gtk1/utilsres.cpp +++ b/src/gtk1/utilsres.cpp @@ -249,20 +249,20 @@ bool wxGetResource(const wxString& section, const wxString& entry, char **value, wxXMergeDatabases(); XrmDatabase database; - if (file) { + if ( !file.IsEmpty() ) { char buffer[500]; // Is this right? Trying to get it to look in the user's // home directory instead of current directory -- JACS (void)GetIniFile(buffer, file); wxNode *node = (wxNode*) NULL; /* suppress egcs warning */ - node = wxTheResourceCache->Find(buffer); + node = wxTheResourceCache->Find(buffer); if (node) - { + { database = (XrmDatabase)node->Data(); - } - else - { + } + else + { database = XrmGetFileDatabase(buffer); wxLogTrace(wxTraceResAlloc, "Get: Number = %d", wxTheResourceCache->Number()); wxTheResourceCache->Append(buffer, (wxObject *)database);