projects
/
platform
/
upstream
/
glib.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
GApplication: Plug a memory leak
[platform/upstream/glib.git]
/
gio
/
gdbus-tool.c
diff --git
a/gio/gdbus-tool.c
b/gio/gdbus-tool.c
index
01a6c68
..
f24dd71
100644
(file)
--- a/
gio/gdbus-tool.c
+++ b/
gio/gdbus-tool.c
@@
-13,9
+13,7
@@
* Lesser General Public License for more details.
*
* You should have received a copy of the GNU Lesser General
* Lesser General Public License for more details.
*
* You should have received a copy of the GNU Lesser General
- * Public License along with this library; if not, write to the
- * Free Software Foundation, Inc., 59 Temple Place, Suite 330,
- * Boston, MA 02111-1307, USA.
+ * Public License along with this library; if not, see <http://www.gnu.org/licenses/>.
*
* Author: David Zeuthen <davidz@redhat.com>
*/
*
* Author: David Zeuthen <davidz@redhat.com>
*/
@@
-671,18
+669,24
@@
handle_emit (gint *argc,
&error);
if (value == NULL)
{
&error);
if (value == NULL)
{
+ gchar *context;
+
+ context = g_variant_parse_error_print_context (error, (*argv)[n]);
g_error_free (error);
error = NULL;
value = _g_variant_parse_me_harder (NULL, (*argv)[n], &error);
if (value == NULL)
{
g_error_free (error);
error = NULL;
value = _g_variant_parse_me_harder (NULL, (*argv)[n], &error);
if (value == NULL)
{
+ /* Use the original non-"parse-me-harder" error */
g_printerr (_("Error parsing parameter %d: %s\n"),
n,
g_printerr (_("Error parsing parameter %d: %s\n"),
n,
-
error->message
);
+
context
);
g_error_free (error);
g_error_free (error);
+ g_free (context);
g_variant_builder_clear (&builder);
goto out;
}
g_variant_builder_clear (&builder);
goto out;
}
+ g_free (context);
}
g_variant_builder_add_value (&builder, value);
}
}
g_variant_builder_add_value (&builder, value);
}
@@
-973,6
+977,9
@@
handle_call (gint *argc,
&error);
if (value == NULL)
{
&error);
if (value == NULL)
{
+ gchar *context;
+
+ context = g_variant_parse_error_print_context (error, (*argv)[n]);
g_error_free (error);
error = NULL;
value = _g_variant_parse_me_harder (type, (*argv)[n], &error);
g_error_free (error);
error = NULL;
value = _g_variant_parse_me_harder (type, (*argv)[n], &error);
@@
-984,19
+991,21
@@
handle_call (gint *argc,
g_printerr (_("Error parsing parameter %d of type '%s': %s\n"),
n,
s,
g_printerr (_("Error parsing parameter %d of type '%s': %s\n"),
n,
s,
-
error->message
);
+
context
);
g_free (s);
}
else
{
g_printerr (_("Error parsing parameter %d: %s\n"),
n,
g_free (s);
}
else
{
g_printerr (_("Error parsing parameter %d: %s\n"),
n,
-
error->message
);
+
context
);
}
g_error_free (error);
g_variant_builder_clear (&builder);
}
g_error_free (error);
g_variant_builder_clear (&builder);
+ g_free (context);
goto out;
}
goto out;
}
+ g_free (context);
}
g_variant_builder_add_value (&builder, value);
}
}
g_variant_builder_add_value (&builder, value);
}
@@
-1017,8
+1026,11
@@
handle_call (gint *argc,
&error);
if (result == NULL)
{
&error);
if (result == NULL)
{
- g_printerr (_("Error: %s\n"), error->message);
- g_error_free (error);
+ if (error)
+ {
+ g_printerr (_("Error: %s\n"), error->message);
+ g_error_free (error);
+ }
if (in_signature_types != NULL)
{
GString *s;
if (in_signature_types != NULL)
{
GString *s;
@@
-1723,16
+1735,12
@@
handle_monitor (gint *argc,
gchar *s;
GError *error;
GDBusConnection *c;
gchar *s;
GError *error;
GDBusConnection *c;
- GVariant *result;
- GDBusNodeInfo *node;
gboolean complete_names;
gboolean complete_paths;
GMainLoop *loop;
ret = FALSE;
c = NULL;
gboolean complete_names;
gboolean complete_paths;
GMainLoop *loop;
ret = FALSE;
c = NULL;
- node = NULL;
- result = NULL;
modify_argv0_for_command (argc, argv, "monitor");
modify_argv0_for_command (argc, argv, "monitor");
@@
-1875,10
+1883,6
@@
handle_monitor (gint *argc,
ret = TRUE;
out:
ret = TRUE;
out:
- if (node != NULL)
- g_dbus_node_info_unref (node);
- if (result != NULL)
- g_variant_unref (result);
if (c != NULL)
g_object_unref (c);
g_option_context_free (o);
if (c != NULL)
g_object_unref (c);
g_option_context_free (o);