Hello Abdalla,

abdalla ramadan wrote:
> Thanks for your reply, and sorry for my very late reply, but i was busy 
> trying a lot to get rid of the memory leak, i tried a lot of memory leak 
> detectors with no luck. Now it's better but i still have big memory leak 
> i used the code snippest at 
> http://opensg.vrsource.org/trac/wiki/Tutorial/OpenSG1/Memleak of 
> detecting the live FCs at exit, it helped me a lot, now i have 45 FCs 
> that haven't been destroyed including images, which i believe it's the 
> one taking memory, i also find shader parameters, and i have never used 
> shaders in the program, i tried the following at the opening of a new 
> file i added it to the code from the page

the shader parameters are created internally by OpenSG as it provides 
some uniform variables that are available to shaders.
I don't think there are any Images created though, so those are probably 
part of your model.

> for(int i = 0; i < fc.getRefCount(); i++)
>                 subRef(fc);
> it worked well in getting rid of memory leaks, but some times when i 
> load another model the dll crashes, at random places in the program,

the above may free the memory, but if the objects you destroy are still 
referenced somewhere you also introduce dangling pointers, which I 
suspect cause the crashes later on. I think your best bet is trying to 
find which objects that are alive where part of your scene, then see why 
they still have references.

> by 
> the way to step into the opensg code shouldn't i have *.dbg, or *.pdb files?
> Also some times it works perfectly so i'm pretty confused.

On windows the OpenSG debug libraries have names that end with a D to 
distinguish them from the release libs. I'm sorry this and the fact that 
mixing debug and release libs on windows causes strange runtime errors 
is about all I know about development on windows, so I can't really help 
with that.

        Hope it helps,
                Carsten

-------------------------------------------------------------------------
This SF.net email is sponsored by: Microsoft
Defy all challenges. Microsoft(R) Visual Studio 2008.
http://clk.atdmt.com/MRT/go/vse0120000070mrt/direct/01/
_______________________________________________
Opensg-users mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/opensg-users

Reply via email to