summaryrefslogtreecommitdiff
path: root/test/c_glib
diff options
context:
space:
mode:
authorChandler May <cjmay4754@gmail.com>2016-01-18 11:05:40 -0500
committerJens Geyer <jensg@apache.org>2016-01-19 22:00:48 +0100
commit3fe3df2ac8af11351643db8684cbafa216f03f99 (patch)
treec4ef7241fff4c197ead4b3fbf740c1ec434182f9 /test/c_glib
parent6dde90be2e15ae84e84671274e034643a33d738f (diff)
downloadthrift-3fe3df2ac8af11351643db8684cbafa216f03f99.tar.gz
THRIFT-3567 GLib-GObject-CRITICAL **: g_object_unref: assertion 'G_IS_OBJECT (object)' failed
Client: c_glib Patch: Chandler May <cjmay4754@gmail.com> This closes #806
Diffstat (limited to 'test/c_glib')
-rw-r--r--test/c_glib/src/thrift_test_handler.c14
1 files changed, 9 insertions, 5 deletions
diff --git a/test/c_glib/src/thrift_test_handler.c b/test/c_glib/src/thrift_test_handler.c
index 8312ad9b8..1d8bcb25a 100644
--- a/test/c_glib/src/thrift_test_handler.c
+++ b/test/c_glib/src/thrift_test_handler.c
@@ -520,11 +520,15 @@ thrift_test_handler_test_insanity (TTestThriftTestIf *iface,
GINT_TO_POINTER (T_TEST_NUMBERZ_THREE),
(gpointer)argument);
- /* Increment argument's ref count since first_map now holds two
- references to it and would otherwise attempt to deallocate it
- twice during destruction. We do this instead of creating a copy
- of argument in order to mimic the C++ implementation (and since,
- frankly, the world needs less argument, not more). */
+ /* Increment argument's ref count by two because first_map now holds
+ two references to it and the caller is not aware we have made any
+ additional references to argument. (That is, caller owns argument
+ and will unref it explicitly in addition to unref-ing *_return.)
+
+ We do this instead of creating a copy of argument in order to mimic
+ the C++ implementation (and since, frankly, the world needs less
+ argument, not more). */
+ g_object_ref ((gpointer)argument);
g_object_ref ((gpointer)argument);
looney = g_object_new (T_TEST_TYPE_INSANITY, NULL);