G_IMPLEMENT_INTERFACE (G_TYPE_ASYNC_RESULT,
g_simple_async_result_async_result_iface_init))
+static void
+clear_op_res (GSimpleAsyncResult *simple)
+{
+ if (simple->destroy_op_res)
+ simple->destroy_op_res (simple->op_res.v_pointer);
+ simple->destroy_op_res = NULL;
+ simple->op_res.v_ssize = 0;
+}
+
static void
g_simple_async_result_finalize (GObject *object)
{
if (simple->source_object)
g_object_unref (simple->source_object);
- if (simple->destroy_op_res)
- simple->destroy_op_res (simple->op_res.v_pointer);
+ clear_op_res (simple);
if (simple->error)
g_error_free (simple->error);
{
g_return_if_fail (G_IS_SIMPLE_ASYNC_RESULT (simple));
+ clear_op_res (simple);
simple->op_res.v_pointer = op_res;
simple->destroy_op_res = destroy_op_res;
}
gssize op_res)
{
g_return_if_fail (G_IS_SIMPLE_ASYNC_RESULT (simple));
+ clear_op_res (simple);
simple->op_res.v_ssize = op_res;
}
gboolean op_res)
{
g_return_if_fail (G_IS_SIMPLE_ASYNC_RESULT (simple));
+ clear_op_res (simple);
simple->op_res.v_boolean = !!op_res;
}