]> git.saurik.com Git - wxWidgets.git/commitdiff
Fixed wxexpr.cpp bug (quote wasn't being removed in new MB code);
authorJulian Smart <julian@anthemion.co.uk>
Mon, 19 Apr 1999 10:14:51 +0000 (10:14 +0000)
committerJulian Smart <julian@anthemion.co.uk>
Mon, 19 Apr 1999 10:14:51 +0000 (10:14 +0000)
fixed one of the remaining memory leaks (wxMSW, wxDefaultValidator)

git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@2229 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775

include/wx/event.h
src/common/wxexpr.cpp
src/msw/app.cpp

index cb0c18d5a7d107d92f083c26ecb395edacf891cc..6a1fd599d9dae9f0c810526bf020f61acfe37446 100644 (file)
@@ -1194,6 +1194,10 @@ public:
 
     bool SearchDynamicEventTable( wxEvent& event );
 
+#if wxUSE_THREADS
+    void ClearEventLocker() { delete m_eventsLocker; m_eventsLocker = NULL; };
+#endif
+
 private:
     static const wxEventTableEntry         sm_eventTableEntries[];
 
@@ -1203,18 +1207,18 @@ protected:
     virtual const wxEventTable *GetEventTable() const;
 
 protected:
-    wxEvtHandler*      m_nextHandler;
-    wxEvtHandler*      m_previousHandler;
-    bool               m_enabled;           // Is event handler enabled?
-    wxList*            m_dynamicEvents;
-    wxList*           m_pendingEvents;
+    wxEvtHandler*       m_nextHandler;
+    wxEvtHandler*       m_previousHandler;
+    bool                m_enabled;           // Is event handler enabled?
+    wxList*             m_dynamicEvents;
+    wxList*                m_pendingEvents;
 #if wxUSE_THREADS
-    wxCriticalSection* m_eventsLocker;
+    wxCriticalSection*  m_eventsLocker;
 #endif
 
     // optimization: instead of using costly IsKindOf() to decide whether we're
     // a window (which is true in 99% of cases), use this flag
-    bool              m_isWindow;
+    bool                m_isWindow;
 };
 
 typedef void (wxEvtHandler::*wxEventFunction)(wxEvent&);
index 1d82a95ba18c797f7391817d2d062ec63e8437c7..227efb2850a888fddd05513167cf76477942d4db 100644 (file)
@@ -1197,13 +1197,13 @@ char *wxmake_string(char *str)
   int len, i;
   const wxMB2WXbuf sbuf = wxConv_libc.cMB2WX(str);
 
-  str++;                       /* skip leading quote */
+//  str++;                     /* skip leading quote */
   len = wxStrlen(sbuf) - 1;    /* ignore trailing quote */
     
   s = new wxChar[len + 1];
     
   t = s;
-  for(i=0; i<len; i++)
+  for(i=1; i<len; i++) // 1 since we want to skip leading quote
   {
     if (sbuf[i] == _T('\\') && sbuf[i+1] == _T('"'))
     {
index be78f823197272033a8157f6a35ec3b61c709733..2ca841caa52b4092e38b7744bf2c9637153100f2 100644 (file)
@@ -562,6 +562,8 @@ void wxApp::CleanUp()
 #if wxUSE_THREADS
     delete wxPendingEvents;
     delete wxPendingEventsLocker;
+    // If we don't do the following, we get an apparent memory leak.
+    ((wxEvtHandler&) wxDefaultValidator).ClearEventLocker();
 #endif
 
     wxClassInfo::CleanUpClasses();