THRIFT-2490 c_glib: if fail to read a exception from server, client may be occurred...
authorRoger Meier <roger@apache.org>
Sun, 4 May 2014 19:52:36 +0000 (21:52 +0200)
committerRoger Meier <roger@apache.org>
Sun, 4 May 2014 19:52:36 +0000 (21:52 +0200)
Client: c_glib
Patch: Jaesang Kim

compiler/cpp/src/generate/t_c_glib_generator.cc

index 9e3ac3c..5195224 100644 (file)
@@ -2662,6 +2662,9 @@ void t_c_glib_generator::generate_deserialize_struct(ofstream &out,
   indent_up();
   if (allocate) {
     indent(out) << "g_object_unref (" << prefix << ");" << endl;
+    if (tstruct->is_xception()) {
+      indent(out) << prefix << " = NULL;" << endl;
+    }
   }
   out <<
     indent() << "return " << error_ret << ";" << endl;