I'm hoping someone can clarify some things for me on this.  I have some VERY
basic startup/shutdown code here for embedding Gecko.  Basically all I do is
create an nsILocalFile object, call NS_NewLocalFile (), pass that to
NS_InitEmbedding (), then call NS_TermEmbedding ().  Code is below.

//Some temp vars
nsILocalFile *pilfBinDir = nsnull;

//Initializing XPCOM
//--------------------------------
//Path to the Mozilla bin directory
rv = NS_NewLocalFile (NS_LITERAL_STRING("E:\\mozilla\\dist\\bin"), PR_TRUE,
&pilfBinDir);

//Starting
rv = NS_InitEmbedding (pilfBinDir, nsnull);

//Releasing
pilfBinDir->Release ();
pilfBinDir = nsnull;

//Killing
rv = NS_TermEmbedding ();

I'm using Windows 2K BTW. Yes, I realize I'm not using an nsCOMPtr, I tried
using it on my previous attempt and was still showing a possible mem leak,
so wanted to try it this way. My internal mem checking code shows no leaks
but if I run the debug exe in AQTime (memory profiling program) it tells me
that there are leaks in the program, here are a few examples of where it
says they are:

NS_NewLocalFile () seems to be generating quite a few (how? I have NO clue)
NS_InitXPCOM2 () within nsEmbedAPI.cpp seems to be generating some
The line "rv = registrar->AutoRegister(nsnull);" in nsEmbedAPI.cpp
The line "mStartupNotifier->Observe(nsnull, APPSTARTUP_TOPIC, nsnull);" in
nsEmbedAPI.cpp

Those are the main ones. I did verify that before I put the above code into
my program that the program was reported to have no leaks (Basic Win32
template) by AQTime. When the program finished, AQTime says it found 3,962
leaked bytes.  I just want to try to get to the bottom of this...whether
AQTime is pullin my leg, or if I'm forgetting to shut something
down...whatever it may be.  Any and all help would be greatly appreciated!
Thanks in advance!

Niky Williams



_______________________________________________
mozilla-embedding mailing list
mozilla-embedding@mozilla.org
http://mail.mozilla.org/listinfo/mozilla-embedding

Reply via email to