]> mj.ucw.cz Git - libucw.git/commitdiff
Fastbuf: fbmulti_close
authorJan 'Moskyt' Matejka <mq@ucw.cz>
Mon, 9 Jul 2012 15:15:30 +0000 (17:15 +0200)
committerJan 'Moskyt' Matejka <mq@ucw.cz>
Thu, 19 Jul 2012 13:25:27 +0000 (15:25 +0200)
ucw/fb-multi.c

index e5ab5bdc220e88205a0c05beeb2153c1745779cd..23a45611d5e049e6dc5c6a4a19514ec4735478b9 100644 (file)
@@ -150,6 +150,14 @@ fbmulti_update_capability(struct fastbuf *f) {
   }
 }
 
+static void
+fbmulti_close(struct fastbuf *f) {
+  CLIST_FOR_EACH(struct subbuf *, n, *(FB_MULTI(f)->subbufs))
+    bclose(n->fb);
+
+  mp_delete(FB_MULTI(f)->mp);
+}
+
 struct fastbuf*
 fbmulti_create(uns bufsize, ...)
 {
@@ -179,6 +187,7 @@ fbmulti_create(uns bufsize, ...)
   fb_out->name = "<multi>";
 
   fbmulti_update_capability(fb_out);
+  fb_out->close = fbmulti_close;
 
   return fb_out;
 }