]> git.sesse.net Git - vlc/blobdiff - bindings/cil/src/exception.cs
Cleanup IDisposable support
[vlc] / bindings / cil / src / exception.cs
index 2b3118fa435a232a4de5f896d75f93374ba884f6..b8b3a8861be8c3efc3aaf3c7787bb6aad780d587 100644 (file)
@@ -105,12 +105,6 @@ namespace VideoLAN.LibVLC
         private static extern void Init (NativeException e);
         [DllImport ("libvlc.dll", EntryPoint="libvlc_exception_clear")]
         private static extern void Clear (NativeException e);
-        /*[DllImport ("libvlc.dll",
-                    EntryPoint="libvlc_exception_raised")]
-        private static extern int Raised (NativeException e);*/
-        [DllImport ("libvlc.dll",
-                    EntryPoint="libvlc_exception_get_message")]
-        private static extern IntPtr GetMessage (NativeException e);
 
         public NativeException ()
         {
@@ -142,6 +136,17 @@ namespace VideoLAN.LibVLC
 
         /** IDisposable implementation. */
         public void Dispose ()
+        {
+            Dispose (true);
+            GC.SuppressFinalize (this);
+        }
+
+        ~NativeException ()
+        {
+            Dispose (false);
+        }
+
+        private void Dispose (bool disposing)
         {
             Clear (this);
         }