Autocomplete and wxLogTrace

If you are using the main C++ distribution of wxWidgets, Feel free to ask any question related to wxWidgets development here. This means questions regarding to C++ and wxWidgets, not compile problems.
Post Reply
skozlov
Knows some wx things
Knows some wx things
Posts: 26
Joined: Tue Dec 16, 2008 12:54 pm

Autocomplete and wxLogTrace

Post by skozlov »

Faced with one problem.

I have a simple dialog with wxTextCtrl. For this wxTextCtrl i set auto complete strings array. And on dialog closing my application crashes.

I found the problem.
wxTextEntry uses wxIEnumString for autocmplete stuff (src\msw\textentry.cpp) and wxIEnumString::Release() uses wxLogRelease().

wxLogRelease() call wxLog::IsThreadLoggingEnabled():

Code: Select all

/* static */
bool wxLog::IsThreadLoggingEnabled()
{
    return !wxThreadInfo.loggingDisabled;
}
And here wxThreadInfo is NULL, so application crashes.

I changed a little text example (added autocomlete for one of the text widgets) and everything works.

But I'm using custom wxWidgets initialization (http://forums.wxwidgets.org/viewtopic.php?t=25414). And maybe i have to do some extra initialization for logs of sth..

Can anybody help?

Thanks.

PS. Currently my workaround is:

Code: Select all

// src\msw\ole\oleutils.cpp
void wxLogRelease(const wxChar *szInterface, ULONG cRef)
{
  //wxLogTrace(wxTRACE_OleCalls, wxT("After %s::Release: m_cRef = %d"), szInterface, cRef - 1);
}
WinXp, wxWidgets 2.8.9, wxWidgets-svn, MSVC 9
Post Reply