sim: enable hw_tree_delete in sim_hw_uninstall
authorMike Frysinger <vapier@gentoo.org>
Wed, 12 Jan 2011 22:10:46 +0000 (22:10 +0000)
committerMike Frysinger <vapier@gentoo.org>
Wed, 12 Jan 2011 22:10:46 +0000 (22:10 +0000)
I can't find any history for why the call to hw_tree_delete is commented
out, and the VCS history shows that this goes back to the original import
in 2009.  I did find some vague reference to it from 2000 (pretty close
to the original import of code), but no actual details.

Without this call, every new instance of the sim results in all old
previously allocated resources being leaked.  With some devices, this
isn't just memory, it's things like open file descriptors or mmaps.

So if there are pending issues with this, I'd rather we get the sims
sorted out rather than continuing to leak this stuff.  Especially since
the "let's wait for the sims to fix themselves" hasn't actually happened
in the last 10+ years.

Signed-off-by: Mike Frysinger <vapier@gentoo.org>
sim/common/ChangeLog
sim/common/sim-hw.c

index 65e711493b9e8c71aba44ad601d28f64cbaa817b..7add3c4d1cf1d737e72730746bb9a4de7a9cd16e 100644 (file)
@@ -1,3 +1,7 @@
+2011-01-12  Mike Frysinger  <vapier@gentoo.org>
+
+       * sim-hw.c (sim_hw_uninstall): Uncomment hw_tree_delete.
+
 2011-01-12  Mike Frysinger  <vapier@gentoo.org>
 
        * sim-module.c (sim_pre_argv_init): Return SIM_RC_FAIL when asprintf
index 69c2b1764c8cff2082f15814603ca5165dc681df..6cb406f24d6c8b70c96235df284b3fc404b087a8 100644 (file)
@@ -319,7 +319,7 @@ sim_hw_init (struct sim_state *sd)
 static void
 sim_hw_uninstall (struct sim_state *sd)
 {
-  /* hw_tree_delete (STATE_HW (sd)->tree); */
+  hw_tree_delete (STATE_HW (sd)->tree);
   zfree (STATE_HW (sd));
   STATE_HW (sd) = NULL;
 }
This page took 0.02849 seconds and 4 git commands to generate.