exhibit manager progress
[laserbrain_demo] / src / blob_exhibit.cc
index 0378359..5e9f213 100644 (file)
@@ -41,6 +41,7 @@ BlobExhibit::BlobExhibit()
 
 BlobExhibit::~BlobExhibit()
 {
+       destroy();
        delete priv;
 }
 
@@ -62,8 +63,10 @@ bool BlobExhibit::init()
 
 void BlobExhibit::destroy()
 {
-       msurf_free(priv->msurf);
-       priv->msurf = 0;
+       if(priv->msurf) {
+               msurf_free(priv->msurf);
+               priv->msurf = 0;
+       }
 }
 
 void BlobExhibit::update(float dt)