You are viewing a plain text version of this content. The canonical link for it is here.
Posted to log4cxx-user@logging.apache.org by Fabian Jacquet <fa...@gmail.com> on 2010/10/05 10:49:40 UTC

Async appender and const char *

Hi all,

We detected a problem if we use a dynamic DLL using Log4cxx on Windows.
We use AsyncAppenders and we have a lot of DLL dynamically loaded.

LocationInfo::fileName and methodName are const char* but it's possible that
the AsyncAppender use those variables after the unload of the DLL which
added the message. So the char* redirect to a deleted memory.
The application crash after the unload of the dll if the AsyncAppender is a
bit slow.

To fix this problem we replaced the type of those two variables to
std::string. So we have a copy.

But we don't know if this is the best solution.