WIP: pth transistion, 3rd step, commands basically ported
[rxpd] / src / rxpd_file.c
index d49644b233a95435eda1d946820dee6d3d45cc2e..d0341b15cb10e84fbac909e2c970c1e6204fbb8d 100644 (file)
@@ -58,6 +58,18 @@ rxpd_file_new (struct rxpd_base* base, const char* filename)
 
 void
 rxpd_file_delete (struct rxpd_file* self)
+{
+  if (self)
+    {
+      rxpd_file_rules_delete (self);
+      psplay_remove (&self->base->files, &self->node);
+      free ((void*)self->filename);
+      free (self);
+    }
+}
+
+struct rxpd_file*
+rxpd_file_rules_delete (struct rxpd_file* self)
 {
   if (self)
     {
@@ -66,10 +78,8 @@ rxpd_file_delete (struct rxpd_file* self)
           struct rxpd_rule* node = (struct rxpd_rule*)n;
           rxpd_rule_delete (node);
         }
-      psplay_remove (&self->base->files, &self->node);
-      free ((void*)self->filename);
-      free (self);
     }
+  return self;
 }
 
 int