=====================================================================

001 Memory leak with SoSelection.

    To reproduce, use a recent version of Coin from CVS, set the
    envvar COIN_DEBUG_TRACK_SOBASE_INSTANCES=1, then run the following
    example. Click on the "A" to select it, then while it is still
    selected, quit the application. The debug dump at the end shows
    that there is most likely an SoPath that has not been freed,
    causing all the nodes in the path to also stick around after exit.

----8<----- [snip] --------------------8<----- [snip] ----------------
#include <Inventor/Qt/SoQt.h>
#include <Inventor/Qt/viewers/SoQtExaminerViewer.h>
#include <Inventor/nodes/SoNode.h>
#include <Inventor/nodes/SoSelection.h>
#include <Inventor/actions/SoBoxHighlightRenderAction.h>
#include <Inventor/SoPickedPoint.h>

// *************************************************************************

static SoPath *
myPickFilterCB(void* userData, const SoPickedPoint* pick)
{
  return pick->getPath();
}


// *************************************************************************

static const char ivfile[] = "#Inventor V2.1 ascii\n\n"
"DEF SELECTION Selection {\n"
"   PickStyle { style BOUNDING_BOX }\n"
"   Text3 { string \"A\" }\n"
"}";

// *************************************************************************

int
main(int argc, char ** argv)
{
  QWidget * window = SoQt::init(argv[0]);

  SoInput * in = new SoInput;
  in->setBuffer((void *)ivfile, strlen(ivfile));

  SoNode * root = SoDB::readAll(in);
  assert(root);
  root->ref();

  SoQtExaminerViewer * viewer = new SoQtExaminerViewer(window);

  SoBoxHighlightRenderAction * a = new SoBoxHighlightRenderAction;
  viewer->setGLRenderAction(a);
  SoSelection * s = (SoSelection *)SoNode::getByName("SELECTION");
  assert(s);
  viewer->redrawOnSelectionChange(s);

  s->setPickFilterCallback(myPickFilterCB);

  viewer->setSceneGraph(root);
  viewer->show();
  viewer->setFeedbackVisibility(TRUE);
  SoQt::show(window);

  SoQt::mainLoop();

  delete viewer;
  delete a;
  root->unref();

  SoDB::cleanup();

  return 0;
}

----8<----- [snip] --------------------8<----- [snip] ----------------

    20041018 mortene.

=====================================================================

011 Possible resource leak in cc_error_default_handler_cb()

    The FILE * returned from coin_get_stderr() shouldn't be cached
    as it might be invalid or leak memory the next time we want to use
    it:

    static FILE * coin_stderr = NULL;
    if (!coin_stderr) { coin_stderr = coin_get_stderr(); }

    20060206 kintel.

=====================================================================

036 assert on repeated SoDB::init(); SoDB::finish()

    Doing this

      SoDB::init();
      SoDB::finish();
      SoDB::init();
      SoDB::finish();


    results in


     ../../../../src/Coin/src/nodes/SoSceneTextureCubeMap.cpp:213: static void SoSceneTextureCubeMap::initClass(): Assertion `SoSceneTextureCubeMap::classTypeId == SoType::badType() && "don't init() twice!"' failed.

=====================================================================

037 Memory leak when copying SoShapeKit

    Doing a copy() the following scenegraph leaks SoBase instances:

    SoBase-derived instances not deallocated:
        0x3713bf0 Separator (no name)
        0x3713e60 Cube (no name)
        0x3713980 Separator (no name)

    #Inventor V2.1 ascii
    Separator {
      ShapeKit {
      }
    }

    20060210 kintel.

    Update: It appears all nodekits leak more or less the same way.

=====================================================================

038 Memory leak when reading files with field connections from inlined nodes

    Reading this file causes the TEST node to leak

    #Inventor V2.1 ascii
    Separator {
      Translation {
         translation 0 0 0 = DEF TEST Translation { }.translation
      }
    }

    20060210 kintel.

=====================================================================
