// The constraint MUST exist in the collection
        // Could be called if the constraint was previously removed.
        // Return 'true' if the constraint was actually removed and disposed.
        public bool RemoveAndDestroyConstraint(BSConstraint constrain)
        {
            bool removed = false;

            // remove the constraint from our collection
            removed = m_constraints.Remove(constrain);
            // Dispose() is safe to call multiple times
            constrain.Dispose();
            return(removed);
        }
Esempio n. 2
0
 // The constraint MUST exist in the collection
 public bool RemoveAndDestroyConstraint(BSConstraint constrain)
 {
     lock (m_constraints)
     {
         // remove the constraint from our collection
         m_constraints.Remove(constrain);
     }
     // tell the engine that all its structures need to be freed
     constrain.Dispose();
     // we destroyed something
     return(true);
 }
        // The constraint MUST exist in the collection
        // Could be called if the constraint was previously removed.
        // Return 'true' if the constraint was actually removed and disposed.
        public bool RemoveAndDestroyConstraint(BSConstraint constrain)
        {
            bool removed = false;

            m_constraintsRwLock.AcquireWriterLock(-1);
            try
            {
                // remove the constraint from our collection
                removed = m_constraints.Remove(constrain);
            }
            finally
            {
                m_constraintsRwLock.ReleaseWriterLock();
            }
            // Dispose() is safe to call multiple times
            constrain.Dispose();
            return(removed);
        }
Esempio n. 4
0
 // The constraint MUST exist in the collection
 public bool RemoveAndDestroyConstraint(BSConstraint constrain)
 {
     lock (m_constraints)
     {
         // remove the constraint from our collection
         m_constraints.Remove(constrain);
     }
     // tell the engine that all its structures need to be freed
     constrain.Dispose();
     // we destroyed something
     return true;
 }
 // The constraint MUST exist in the collection
 // Could be called if the constraint was previously removed.
 // Return 'true' if the constraint was actually removed and disposed.
 public bool RemoveAndDestroyConstraint(BSConstraint constrain)
 {
     bool removed = false;
     // remove the constraint from our collection
     removed = m_constraints.Remove(constrain);
     // Dispose() is safe to call multiple times
     constrain.Dispose();
     return removed;
 }