aboutsummaryrefslogtreecommitdiff
path: root/src/rc.c
diff options
context:
space:
mode:
authorRoy Marples <roy@marples.name>2007-07-04 16:02:01 +0000
committerRoy Marples <roy@marples.name>2007-07-04 16:02:01 +0000
commitf28763d4928a5ffb2c288388299ccf69ee26f26e (patch)
treefb84a019286f470bdb41c1370634ef229371e393 /src/rc.c
parent46156cc8cdfcdcc676d5d5d0a1a753978e412018 (diff)
As we're running each plugin in a fork, we need to call our cleanup code so we don't leak memory. To this extent, we now have the global boolean rc_in_plugin and the cleanup code can act accordingly.
Diffstat (limited to 'src/rc.c')
-rw-r--r--src/rc.c12
1 files changed, 7 insertions, 5 deletions
diff --git a/src/rc.c b/src/rc.c
index 2e2a2e04..ab104a98 100644
--- a/src/rc.c
+++ b/src/rc.c
@@ -83,7 +83,7 @@ static void cleanup (void)
rc_plugin_unload ();
- if (termios_orig) {
+ if (! rc_in_plugin && termios_orig) {
tcsetattr (STDIN_FILENO, TCSANOW, termios_orig);
free (termios_orig);
}
@@ -103,10 +103,12 @@ static void cleanup (void)
rc_strlist_free (types);
/* Clean runlevel start, stop markers */
- if (rc_is_dir (RC_SVCDIR "softscripts.new"))
- rc_rm_dir (RC_SVCDIR "softscripts.new", true);
- if (rc_is_dir (RC_SVCDIR "softscripts.old"))
- rc_rm_dir (RC_SVCDIR "softscripts.old", true);
+ if (! rc_in_plugin) {
+ if (rc_is_dir (RC_SVCDIR "softscripts.new"))
+ rc_rm_dir (RC_SVCDIR "softscripts.new", true);
+ if (rc_is_dir (RC_SVCDIR "softscripts.old"))
+ rc_rm_dir (RC_SVCDIR "softscripts.old", true);
+ }
free (applet);
}