Menu

Question on clean up

Help
emfau
2002-11-08
2002-12-10
  • emfau

    emfau - 2002-11-08

    Hi *,

    (log4cpp v. 0.3.4b/win2k)

    I'm fairly new to log4cpp so I deceided to get used to it by playing around a bit with the code provided as test cases.
    I implemented some simple wrapper around log4cpp and added them to a project I'm working on. This project includes a facility for checking memory leaks - and it reports a lot of them in the log4cpp code. My guess is that the way I cleanup my class is not correct. I'm calling log4cpp::Category::shutdown() for freeing all memory as this is done in the test cases but that's not sufficient. I scanned through the documentation and CVS and realized the Log4CppCleanup class which is not any longer availabe.
    Are there any plans to revive such a central cleanup methd?
    If not, how am I supposed to clean up everything?

    Thanks
       Michael

     
    • ms

      ms - 2002-12-09

      You're not using wxWindows by any chance are you?   I'm having the same problem.

      What exactly are the memory problems you're having?  If the "facility for checking memory leaks" does it's work by redefining "new" then you could always undefine this change before you include any log4cpp header files?

      #ifdef new
      #undef new
      #endif

      cheers.

       
      • emfau

        emfau - 2002-12-09

        Our application uses the CRT debug heap functions as described in "http://msdn.microsoft.com/library/default.asp?url=/library/en-us/dnvc60/html/memleaks.asp"
        (i.e. using redefined versions of malloc and free which ultimatly are called by new and delete as well)

        When activated the debug heap functions create a report at shutdown time of  our application showing a bunch of memory leaks - all generated from within log4cpp.
        After checking the code this is pretty obvious as no destructor is called for neither _defaultMaintainer nor one of its associated objects.
        So my memory "problems" are systematic that's why I asked for the right way of cleaning things up.

        best
        Michael

         
    • ms

      ms - 2002-12-09

      Hmmm, I'm not sure then.  I've just tried to use 0.3.4b instead of 0.2.7 in hope of solving these problems but I can't even get it to work - it crashes out in Appender::_addAppender().  

      I don't suppose you have a working MS Visual C++ project which you could email me do you?  

      Regards.

       
      • emfau

        emfau - 2002-12-10

        Sorry to say, but you are right. The working code is part of a larger project and not easily extracted.
        What about the tests, are they also crashing?
        If so I would suspect installation problems causing the trouble. They worked fine for me and were a good starting point to checkout the APIs.

        best

         

Log in to post a comment.

Want the latest updates on software, tech news, and AI?
Get latest updates about software, tech news, and AI from SourceForge directly in your inbox once a month.