]> git.saurik.com Git - wxWidgets.git/blobdiff - src/common/ctrlsub.cpp
Add some asserts to ensure cols and rows are >= 0 to avoid crashes
[wxWidgets.git] / src / common / ctrlsub.cpp
index d0a197da1fe2f92cc62e7a0937822e88f3f9b45d..68d4b1a5916150f05b753abca0a2c6d77307e0f2 100644 (file)
@@ -191,6 +191,18 @@ wxClientData *wxItemContainer::GetClientObject(unsigned int n) const
     return static_cast<wxClientData *>(DoGetItemClientData(n));
 }
 
+wxClientData *wxItemContainer::DetachClientObject(unsigned int n)
+{
+    wxClientData * const data = GetClientObject(n);
+    if ( data )
+    {
+        // reset the pointer as we don't own it any more
+        DoSetItemClientData(n, NULL);
+    }
+
+    return data;
+}
+
 void wxItemContainer::SetClientData(unsigned int n, void *data)
 {
     if ( !HasClientData() )