]> git.mxchange.org Git - flightgear.git/blobdiff - src/Objects/newmat.hxx
Nuked the segfault on exit bug everyone was seeing. The material lib could
[flightgear.git] / src / Objects / newmat.hxx
index acd9169bed0bdff875590824db086cbf404914ab..72a92ecc3232815d5cbfb9cdf3406e91cfa80749 100644 (file)
@@ -92,6 +92,10 @@ private:
     // true if texture loading deferred, and not yet loaded
     bool texture_loaded;
 
+    // ref count so we can properly delete if we have multiple
+    // pointers to this record
+    int refcount;
+
 public:
 
     // Constructor
@@ -144,6 +148,10 @@ public:
 
     inline ssgStateSelector *get_state() const { return state; }
 
+    inline void ref() { refcount++; }
+    inline void deRef() { refcount--; }
+    inline int getRef() const { return refcount; }
+
     void dump_info();
 };