eldbus-codegen: More memory leak fixes for generated code.

Same fix as we did for simple method calls we need in complex method calls as
well. Unref message on error path.

@fix
This commit is contained in:
Stefan Schmidt 2014-11-24 10:04:03 +01:00
parent 53537579cd
commit 0b06725e18
1 changed files with 2 additions and 0 deletions

View File

@ -101,6 +101,7 @@ source_client_complex_method_call_generate(const DBus_Method *method, Eina_Strbu
eina_strbuf_append_printf(c_code, " if (!eldbus_message_from_eina_value(\"%s\", msg, args))\n", eina_strbuf_string_get(full_signature));
eina_strbuf_append_printf(c_code, " {\n");
eina_strbuf_append_printf(c_code, " ERR(\"Error: Filling message from eina value.\");\n");
eina_strbuf_append_printf(c_code, " eldbus_message_unref(msg);\n");
eina_strbuf_append_printf(c_code, " return;\n");
eina_strbuf_append_printf(c_code, " }\n");
eina_strbuf_append_printf(c_code, " eldbus_proxy_send(proxy, msg, %s, NULL, -1);\n", method->cb_name);
@ -120,6 +121,7 @@ source_client_complex_method_call_generate(const DBus_Method *method, Eina_Strbu
eina_strbuf_append_printf(c_code, " if (!eldbus_message_from_eina_value(\"%s\", msg, args))\n", eina_strbuf_string_get(full_signature));
eina_strbuf_append_printf(c_code, " {\n");
eina_strbuf_append_printf(c_code, " ERR(\"Error: Filling message from eina value.\");\n");
eina_strbuf_append_printf(c_code, " eldbus_message_unref(msg);\n");
eina_strbuf_append_printf(c_code, " return NULL;\n");
eina_strbuf_append_printf(c_code, " }\n");
eina_strbuf_append_printf(c_code, " p = eldbus_proxy_send(proxy, msg, %s, cb, -1);\n", method->cb_name);