|
|
Choosing A Webhost: |
Usage and VC 7.1 debugger memory leaks: msg#00021apache.logging.log4cxx.user
Hello, I have found a few threads in the archive about memory leaks reported by various versions of the MSVC debugger. None of these threads have contained any resolution that helps me with my problem. My problem occurs due to the way I am using the LoggerPtr, so really what I am looking for is suggestions on how to do it without causing these leaks (or if there is some reason I don't need to worry about them). I realize the common usage is to use a static instance in each class that uses logging and name the logger after the class. If I do it this way, it works without the reported leaks. The problem is I do not want to do this, because I don't want to have to change more than one class if I decide to change logging mechanisms. So I am trying to use a singleton wrapper class. The relevant characteristics of this class are: 1. Private constructor, public method to get an instance. 2. Static member for log4cxx declared as follows: In header: static log4cxx::LoggerPtr logger; In implementation file: log4cxx::LoggerPtr USTLogger::logger(Logger::getLogger("MyLogger")); ------------------------------------------- I am linking the shared log4cxx.lib in another shared .lib that is linked into my .exe Just creating the logger as above results in the "leaks" (i.e. whether I send anything to the log or not). I tried explicitly releasing the LoggerPtr by calling releaseRef() when my singleton is destroyed for good, but that caused an access violation. Does anyone have any suggestions/thoughts on this? Specifically what is the best way to construct a wrapper class for use with log4cxx? Thanks, Mark __________________________________________________ Do You Yahoo!? Tired of spam? Yahoo! Mail has the best spam protection around http://mail.yahoo.com
|
|
| <Prev in Thread] | Current Thread | [Next in Thread> |
|---|---|---|
| Previous by Date: | Re: ant build error - g4cxx: Cannot get information about host: unknown.host.local, Mark |
|---|---|
| Next by Date: | Problem printing string with embedded NULL character, Venkatraju |
| Previous by Thread: | ant build error - g4cxx: Cannot get information about host: unknown.host.local, Mark |
| Next by Thread: | AW: Usage and VC 7.1 debugger memory leaks, Steindl Christian |
| Indexes: | [Date] [Thread] [Top] [All Lists] |
Free MagazinesCisco NewsReceive a free quarterly e-newsletter with exclusive articles on how Cisco IT uses its own products and solutions to enable the business. subscribe Systems Management News, the newspaper for IT systems administration and data center managers! Each issue of Systems Management News is chock-full of news and analysis to help you understand what's happening in your field. subscribe The Enterprise Newsweekly eWeek is the essential technology information source for builders of e-business. subscribe Oracle Magazine Oracle Magazine contains technology strategy articles, sample code, tips, Oracle and partner news, how to articles for developers and DBAs, and more. Oracle (NASDAQ: ORCL) is the world's largest enterprise software company. subscribe Total Telecom Total Telecom is "The Economist of the communications industry". subscribe |