summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--include/m_system_cpp.h5
1 files changed, 3 insertions, 2 deletions
diff --git a/include/m_system_cpp.h b/include/m_system_cpp.h
index 4c8656b4e2..2e71c4dcff 100644
--- a/include/m_system_cpp.h
+++ b/include/m_system_cpp.h
@@ -195,8 +195,9 @@ template<class T> struct OBJLIST : public LIST<T>
__inline int remove(T* p)
{
- if (List_RemovePtr((SortedList*)this, p) != -1) {
- delete p;
+ int i = getIndex( p );
+ if ( i != -1 ) {
+ remove(i);
return 1;
}
return 0;