Ejemplo n.º 1
0
        protected virtual new void Dispose(bool disposing)
        {
            // Check to see if Dispose has already been called.
            if (!m_disposed)
            {
                // If disposing equals true, dispose all managed
                // and unmanaged resources.
                if (disposing)
                {
                    // Dispose managed resources.
                    // none yet

                    if (m_constructionInfo.Handle != IntPtr.Zero)
                    {
                        m_constructionInfo.Dispose();
                    }
                    base.Dispose(false);
                }
                // Release unmanaged resources. If disposing is false,
                // only the following code is executed.
                BulletAPI_BtRigidBody_delete(m_handle);
                m_handle = IntPtr.Zero;
                // Note that this is not thread safe.
                // Another thread could start disposing the object
                // after the managed resources are disposed,
                // but before the disposed flag is set to true.
                // If thread safety is necessary, it must be
                // implemented by the client.
            }
            m_disposed = true;
        }