Moved userspace domain unmap to deactivate instead of release, fixing memory/ref leak.
authorGavin Lambert <gavinl@compacsort.com>
Sat, 31 May 2014 14:49:02 +1200
changeset 2616 f99e5b11806c
parent 2615 bc34e2303fd6
child 2617 559f2f9c5b08
Moved userspace domain unmap to deactivate instead of release, fixing memory/ref leak.
lib/master.c
--- a/lib/master.c	Tue Apr 07 21:25:43 2015 -0400
+++ b/lib/master.c	Sat May 31 14:49:02 2014 +1200
@@ -60,6 +60,11 @@
     ec_domain_t *d, *next_d;
     ec_slave_config_t *c, *next_c;
 
+    if (master->process_data)  {
+        munmap(master->process_data, master->process_data_size);
+        master->process_data = NULL;
+    }
+
     d = master->first_domain;
     while (d) {
         next_d = d->next;
@@ -81,10 +86,6 @@
 
 void ec_master_clear(ec_master_t *master)
 {
-    if (master->process_data)  {
-        munmap(master->process_data, master->process_data_size);
-    }
-
     ec_master_clear_config(master);
 
     if (master->fd != -1) {