THRIFT-1583 c_glib leaks memory
THRIFT-1578 C_GLib generated code does not compile
THRIFT-1582 Bad includes of nested thrift files in c_glib
Patch: José Antonio Santos
Minor Modificatons by roger:
- thrift prefix for includes
- g_object_unref instead of g_clear_object (needs glib>=2.28)
git-svn-id: https://svn.apache.org/repos/asf/thrift/trunk@1331752 13f79535-47bb-0310-9956-ffa450edef68
diff --git a/lib/c_glib/test/testoptionalrequired.c b/lib/c_glib/test/testoptionalrequired.c
index fdd4c1a..4f6fe15 100644
--- a/lib/c_glib/test/testoptionalrequired.c
+++ b/lib/c_glib/test/testoptionalrequired.c
@@ -20,7 +20,7 @@
#include <assert.h>
#include <glib.h>
-#include "thrift_struct.h"
+#include <thrift/thrift_struct.h>
#include <thrift/protocol/thrift_protocol.h>
#include <thrift/protocol/thrift_binary_protocol.h>
#include <thrift/transport/thrift_memory_buffer.h>
@@ -55,8 +55,10 @@
o->im_int = 10;
o->im_str = g_strdup ("test");
o->im_big = g_ptr_array_new ();
- g_ptr_array_free (o->im_big, FALSE);
+ g_ptr_array_free (o->im_big, TRUE);
+ o->im_big = NULL;
g_free (o->im_str);
+ o->im_str = NULL;
g_object_unref (o);
}