summaryrefslogtreecommitdiff
path: root/src/main.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/main.c')
-rw-r--r--src/main.c10
1 files changed, 4 insertions, 6 deletions
diff --git a/src/main.c b/src/main.c
index 44b3201..3b9c243 100644
--- a/src/main.c
+++ b/src/main.c
@@ -178,10 +178,7 @@ client_finished_cb (SoupMessage *msg,
TranscodeClientCtx *ctx)
{
stp_print_status ("Client finished/aborted, doing cleanup...\n");
- /* Make sure not to double-free. If the server
- * has shut down, this will be 0. */
- if (ctx->timeout_handler_id)
- stp_cleanup_transcode_client_ctx (ctx);
+ stp_cleanup_transcode_client_ctx (ctx);
}
static void
@@ -344,8 +341,9 @@ nostreamheader:
G_CALLBACK (client_eos_cb), client_ctx);
g_signal_connect (client_ctx->msg, "wrote-chunk",
G_CALLBACK (can_write_next_client_chunk_cb), client_ctx);
- g_signal_connect (client_ctx->msg, "finished",
- G_CALLBACK (client_finished_cb), client_ctx);
+ client_ctx->finished_handler_id =
+ g_signal_connect (client_ctx->msg, "finished",
+ G_CALLBACK (client_finished_cb), client_ctx);
client_ctx->timeout_handler_id = \
g_timeout_add_seconds (2, (GSourceFunc)increment_write_timer, client_ctx);