Last uiList patch (for now!): filtering and reordering of shown elements.
[blender.git] / source / blender / blenkernel / intern / screen.c
index 924cdff798d1ffb7d9825dd3990fc5026ae581b2..efcbcacf9748d232e578dda99c9e83937f1a7959 100644 (file)
@@ -47,6 +47,7 @@
 #include "BLI_listbase.h"
 #include "BLI_utildefines.h"
 
+#include "BKE_idprop.h"
 #include "BKE_screen.h"
 
 /* ************ Spacetype/regiontype handling ************** */
@@ -290,7 +291,18 @@ void BKE_area_region_free(SpaceType *st, ARegion *ar)
 
        for (uilst = ar->ui_lists.first; uilst; uilst = uilst->next) {
                if (uilst->dyn_data) {
-                       MEM_freeN(uilst->dyn_data);
+                       uiListDyn *dyn_data = uilst->dyn_data;
+                       if (dyn_data->items_filter_flags) {
+                               MEM_freeN(dyn_data->items_filter_flags);
+                       }
+                       if (dyn_data->items_filter_neworder) {
+                               MEM_freeN(dyn_data->items_filter_neworder);
+                       }
+                       MEM_freeN(dyn_data);
+               }
+               if (uilst->properties) {
+                       IDP_FreeProperty(uilst->properties);
+                       MEM_freeN(uilst->properties);
                }
        }
        BLI_freelistN(&ar->ui_lists);