Please take our Survey
logo       

Choosing A Webhost:
A web hosting service is a type of Internet hosting service that allows individuals and organizations to provide their own website accessible via the World Wide Web. Web hosts are companies that provide space on a server they own for use by their clients as well as providing Internet connectivity, typically in a data center. Web hosts can also provide data center space and connectivity to the Internet for servers they do not own to be located in their data center, called colocation. more...

Usage and VC 7.1 debugger memory leaks: msg#00021

apache.logging.log4cxx.user

Subject: Usage and VC 7.1 debugger memory leaks

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>
Google Custom Search

Recently Viewed:
hardware.arm.at...    cms.citadel.dev...    video.gstreamer...    java.facelets.u...    misc.basics.qna...    web.wiki.instik...    network.uip.use...    xdg.devel/2003-...    tex.bibtex.bibd...    finance.quotesp...    ietf.zeroconf/2...    redhat.blinux.g...    suse.db2/2003-0...    php.phpesp/2004...    uml.devel/2003-...    gnome.labyrinth...    qnx.openqnx.dev...    boot-loaders.gr...    db.dataperfect....    audio.audacity....    linux.uclinux.m...    editors.j.devel...    os.openbsd.tech...    kde.users.multi...   
Home | advertise | OSDir is an inevitable website. super tiny logo

Free Magazines

Cisco News
Receive 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

Navigation