]> git.saurik.com Git - wxWidgets.git/commitdiff
Finished up utilities testing
authorDavid Webster <Dave.Webster@bhmi.com>
Thu, 11 Nov 1999 04:40:29 +0000 (04:40 +0000)
committerDavid Webster <Dave.Webster@bhmi.com>
Thu, 11 Nov 1999 04:40:29 +0000 (04:40 +0000)
git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@4470 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775

src/os2/app.cpp
src/os2/utils.cpp

index f0b658c670642983d76f5029e65469ff591cce5d..4cc01d966f516480c3d3d7f9bfac90929d976e8a 100644 (file)
@@ -76,7 +76,7 @@ wxApp *wxTheApp = NULL;
 // FIXME why not const? and not static?
 
 // NB: all "NoRedraw" classes must have the same names as the "normal" classes
-//     with NR suffix - wxWindow::MSWCreate() supposes this
+//     with NR suffix - wxWindow::OS2Create() supposes this
 wxChar wxFrameClassName[]         = wxT("wxFrameClass");
 wxChar wxFrameClassNameNoRedraw[] = wxT("wxFrameClassNR");
 wxChar wxMDIFrameClassName[]      = wxT("wxMDIFrameClass");
@@ -125,7 +125,7 @@ bool wxApp::Initialize()
     //    wxRedirectIOToConsole();
 #endif
 
-    wxBuffer = new wxChar[1500]; // FIXME
+    wxBuffer = new wxChar[1500]; // FIXME; why?
 
     wxClassInfo::InitializeClasses();
 
index c82dfc9a5ae1f9d78b23da1fa8e55b8052944698..9c2ea76d18b71d52fbdb716078e620581abb2034 100644 (file)
@@ -265,6 +265,7 @@ void wxError(
 , const wxString&                   rTitle
 )
 {
+    wxBuffer = new wxChar[256];
     wxSprintf(wxBuffer, "%s\nContinue?", WXSTRINGCAST rMsg);
     if (::WinMessageBox( HWND_DESKTOP
                         ,NULL
@@ -273,6 +274,7 @@ void wxError(
                         ,0
                         ,MB_ICONEXCLAMATION | MB_YESNO
                        ) == MBID_YES)
+    delete[] wxBuffer;
     wxExit();
 }
 
@@ -469,6 +471,8 @@ bool wxGetResource(
 )
 {
     wxChar*                         zStr = NULL;
+
+    zStr = new wxChar[1000];
     bool                            bSucc = wxGetResource( rSection
                                                           ,rEntry
                                                           ,(wxChar **)&zStr
@@ -481,7 +485,11 @@ bool wxGetResource(
         delete[] zStr;
         return TRUE;
     }
-    else return FALSE;
+    else
+    {
+        delete[] zStr;
+        return FALSE;
+    }
 }
 
 bool wxGetResource(
@@ -492,6 +500,8 @@ bool wxGetResource(
 )
 {
     wxChar*                           zStr = NULL;
+
+    zStr = new wxChar[1000];
     bool                              bSucc = wxGetResource( rSection
                                                             ,rEntry
                                                             ,(wxChar **)&zStr
@@ -504,7 +514,11 @@ bool wxGetResource(
         delete[] zStr;
         return TRUE;
     }
-    else return FALSE;
+    else
+    {
+        delete[] zStr;
+        return FALSE;
+    }
 }
 
 bool wxGetResource(
@@ -515,6 +529,8 @@ bool wxGetResource(
 )
 {
     wxChar*                         zStr = NULL;
+
+    zStr = new wxChar[1000];
     bool                            bSucc = wxGetResource( rSection
                                                           ,rEntry
                                                           ,(wxChar **)&zStr
@@ -527,7 +543,11 @@ bool wxGetResource(
         delete[] zStr;
         return TRUE;
     }
-    else return FALSE;
+    else
+    {
+        delete[] zStr;
+        return FALSE;
+    }
 }
 #endif // wxUSE_RESOURCES
 
@@ -603,6 +623,7 @@ wxChar* wxGetUserHome (
     wxChar*                         zHome;
     wxString                        sUser1(rUser);
 
+    wxBuffer = new wxChar[256];
     if (sUser1 != _T(""))
     {
         wxChar                      zTmp[64];
@@ -617,6 +638,7 @@ wxChar* wxGetUserHome (
                 if ((zHome = wxGetenv(_T("TMP"))) != NULL    ||
                     (zHome = wxGetenv(_T("TMPDIR"))) != NULL ||
                     (zHome = wxGetenv(_T("TEMP"))) != NULL)
+                    delete[] wxBuffer;
                     return *zHome ? zHome : (wxChar*)_T("\\");
             }
             if (wxStricmp(zTmp, WXSTRINGCAST sUser1) == 0)
@@ -624,13 +646,18 @@ wxChar* wxGetUserHome (
         }
     }
     if (sUser1 == _T(""))
+    {
         if ((zHome = wxGetenv(_T("HOME"))) != NULL)
         {
             wxStrcpy(wxBuffer, zHome);
             Unix2DosFilename(wxBuffer);
-            return wxBuffer;
+            wxStrcpy(zHome, wxBuffer);
+            delete[] wxBuffer;
+            return zHome;
         }
-        return NULL; // No home known!
+    }
+    delete[] wxBuffer;
+    return NULL; // No home known!
 }
 
 // Check whether this window wants to process messages, e.g. Stop button