]> git.tuebingen.mpg.de Git - paraslash.git/blobdiff - osl.c
Fix osl_del_row().
[paraslash.git] / osl.c
diff --git a/osl.c b/osl.c
index 6294fbbe3f8900f3bf9830a30ccb8bfed150383a..5c80641930af2125cdaf7b7ad17e880abbc16c93 100644 (file)
--- a/osl.c
+++ b/osl.c
@@ -994,8 +994,14 @@ static void free_volatile_objects(const struct osl_table *t,
        for (n = rb_first(&rb_col->rbtree); n; n = rb_next(n)) {
                struct osl_row *r = get_row_pointer(n, rb_col->rbtree_num);
                if (flags & OSL_FREE_VOLATILE)
-                       for (j = 0; j < t->num_volatile_columns; j++)
-                               free(r->volatile_objects[j].data);
+                       FOR_EACH_VOLATILE_COLUMN(j, t, cd) {
+                               if (cd->storage_flags & OSL_DONT_FREE)
+                                       continue;
+                               free(r->volatile_objects[
+                                       t->columns[j].volatile_num].data);
+                       }
+//                     for (j = 0; j < t->num_volatile_columns; j++)
+//                             free(r->volatile_objects[j].data);
                free(r->volatile_objects);
        }
 }
@@ -1569,7 +1575,7 @@ int osl_del_row(struct osl_table *t, struct osl_row *row)
                        mark_mapped_object_invalid(t, r->num, i);
                        continue;
                }
-               if (st == OSL_NO_STORAGE)
+               if (st == OSL_NO_STORAGE && !(cd->storage_flags & OSL_DONT_FREE))
                        free(r->volatile_objects[col->volatile_num].data);
        }
        if (t->num_mapped_columns) {