summaryrefslogtreecommitdiff
path: root/openbox/session.c
diff options
context:
space:
mode:
authorDana Jansens <danakj@orodu.net>2010-02-12 13:55:26 -0500
committerDana Jansens <danakj@orodu.net>2010-02-12 13:55:26 -0500
commit4f93731cdbecbf43b82aa000c07ec8b40f97dd03 (patch)
tree023b9a8787b4488487c0328302516c08c430c948 /openbox/session.c
parent1d57f7b08590255e57dd5931a1993507b4f116c2 (diff)
use g_slice_new() instead of g_new() part 2
Diffstat (limited to 'openbox/session.c')
-rw-r--r--openbox/session.c10
1 files changed, 5 insertions, 5 deletions
diff --git a/openbox/session.c b/openbox/session.c
index ba51ed32..d6c6f767 100644
--- a/openbox/session.c
+++ b/openbox/session.c
@@ -376,7 +376,7 @@ static void session_setup_restart_command(void)
static ObSMSaveData *sm_save_get_data(void)
{
- ObSMSaveData *savedata = g_new0(ObSMSaveData, 1);
+ ObSMSaveData *savedata = g_slice_new0(ObSMSaveData);
/* save the active desktop and client.
we don't bother to preemptively save the other desktop state like
number and names of desktops, cuz those shouldn't be changing during
@@ -398,7 +398,7 @@ static void sm_save_yourself_2(SmcConn conn, SmPointer data)
if (savedata == NULL)
savedata = sm_save_get_data();
success = session_save_to_file(savedata);
- g_free(savedata);
+ g_slice_free(ObSMSaveData, savedata);
/* tell the session manager how to restore this state */
if (success) session_setup_restart_command();
@@ -443,7 +443,7 @@ static void sm_save_yourself(SmcConn conn, SmPointer data, gint save_type,
if (!SmcRequestSaveYourselfPhase2(conn, sm_save_yourself_2, savedata)) {
ob_debug_type(OB_DEBUG_SM, "Requst for phase 2 failed");
- g_free(savedata);
+ g_slice_free(ObSMSaveData, savedata);
SmcSaveYourselfDone(conn, FALSE);
}
}
@@ -630,7 +630,7 @@ static void session_state_free(ObSessionState *state)
g_free(state->class);
g_free(state->role);
- g_free(state);
+ g_slice_free(ObSessionState, state);
}
}
@@ -731,7 +731,7 @@ static void session_load_file(const gchar *path)
{
ObSessionState *state;
- state = g_new0(ObSessionState, 1);
+ state = g_slice_new0(ObSessionState);
if (!obt_xml_attr_string(node, "id", &state->id))
if (!obt_xml_attr_string(node, "command", &state->command))