Hi all,

I've successfully inherited ShadowMapViewport, overrided two methods
and made some changes here and there... all runs well without
problems.

Now I need to add a new TextureChunkPtr variable in my derived class.
Since I dont't need a fieldContainer I only added those few lines:

in header file:
TextureChunkPtr _finalSoftShadowTexture;
ImagePtr _finalSoftShadowImage;

===================================
in source file (constructors):

SoftShadowMapViewport::SoftShadowMapViewport(void) :
    Inherited(),
        _finalSoftShadowImage(NullFC),
        _finalSoftShadowTexture(NullFC)
{
}

SoftShadowMapViewport::SoftShadowMapViewport(const
SoftShadowMapViewport &source) :
    Inherited(source),
                _finalSoftShadowImage(source._finalSoftShadowImage),
                _finalSoftShadowTexture(source._finalSoftShadowTexture)
{
}

===================================
in source file (destructors):

void SoftShadowMapViewport::onDestroy(void)
{
        subRefCP(_finalSoftShadowImage);
        subRefCP(_finalSoftShadowTexture);
}

===================================
in source file (allocation):

        _finalSoftShadowImage = Image::create();
        addRefCP(_finalSoftShadowImage);
        _finalSoftShadowTexture = TextureChunk::create();
        addRefCP(_finalSoftShadowTexture);


This should be right, I think, but on exit it crashes in deleteContainers()

>       OSGSystemD.dll!osg::FieldContainerPtrBase::deleteContainers()  Riga
114 + 0xc       C++
        OSGSystemD.dll!osg::FieldContainerPtrBase::subRef()  Riga 138   C++
        OSGSystemD.dll!osg::subRefCP(const osg::FieldContainerPtrBase &
objectP={...})  Riga 88 C++
        OSGSystemD.dll!osg::FieldContainerType::terminate()  Riga 539 + 0xc     
C++
        OSGSystemD.dll!osg::FieldContainerType::~FieldContainerType()  Riga 166 
C++
        

Am I missing something?

I saw this comment in derived header:
  // Variables should all be in SoftShadowMapViewportBase.
but I don't want a field container...

Any ideas?

Thank you very much,

--
Josef Grunig
www.blending-life.org


-------------------------------------------------------
This SF.net email is sponsored by: Splunk Inc. Do you grep through log files
for problems?  Stop!  Download the new AJAX search engine that makes
searching your log files as easy as surfing the  web.  DOWNLOAD SPLUNK!
http://sel.as-us.falkag.net/sel?cmd=lnk&kid3432&bid#0486&dat1642
_______________________________________________
Opensg-users mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/opensg-users

Reply via email to