Remove tracing from wxWindowID code

wxWindowID objects can be global and thus be destroyed after the library has
been uninitialized and, worse, when some of the global objects have been
already destroyed.

In particular, using wxLogTrace() in DecIdRefCount() called from the dtor
could result in using the possibly already destroyed wxConvLibc object, so
avoid this by not doing any tracing from there.
This commit is contained in:
Vadim Zeitlin 2016-02-09 23:44:14 +01:00
parent f8bfab5284
commit aece1f81b6

View File

@ -26,8 +26,6 @@
// Not needed, included in defs.h
// #include "wx/windowid.h"
#define wxTRACE_WINDOWID wxT("windowid")
namespace
{
@ -130,9 +128,6 @@ void IncIdRefCount(wxWindowID winid)
{
gs_autoIdsRefCount[winid]++;
}
wxLogTrace(wxTRACE_WINDOWID, wxT("Increasing ref count of ID %d to %d"),
winid + wxID_AUTO_LOWEST, GetIdRefCount(winid + wxID_AUTO_LOWEST));
}
// Decrease the count for an id
@ -167,9 +162,6 @@ void DecIdRefCount(wxWindowID winid)
}
else
gs_autoIdsRefCount[winid]--;
wxLogTrace(wxTRACE_WINDOWID, wxT("Decreasing ref count of ID %d to %d"),
winid + wxID_AUTO_LOWEST, GetIdRefCount(winid + wxID_AUTO_LOWEST));
}
#else // wxUSE_AUTOID_MANAGEMENT