summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorPeng Huang <phuang@phuang.nay.redhat.com>2009-02-10 18:02:13 +0800
committerPeng Huang <phuang@phuang.nay.redhat.com>2009-02-10 18:02:13 +0800
commit46dee933ac3c2b140a6d65056a5ed5876302cd25 (patch)
treed30a9e4501cb031592db6ae6f11830414dbaa2aa
parent1e931b56967fd7f589fab3c8081b3bdf13c49f1a (diff)
downloadibus-46dee933ac3c2b140a6d65056a5ed5876302cd25.tar.gz
ibus-46dee933ac3c2b140a6d65056a5ed5876302cd25.tar.xz
ibus-46dee933ac3c2b140a6d65056a5ed5876302cd25.zip
Fix crash problems.
-rw-r--r--bus/inputcontext.c7
-rw-r--r--src/ibusconnection.c30
-rw-r--r--src/ibusmessage.c2
3 files changed, 21 insertions, 18 deletions
diff --git a/bus/inputcontext.c b/bus/inputcontext.c
index c512e82..be45bbe 100644
--- a/bus/inputcontext.c
+++ b/bus/inputcontext.c
@@ -558,13 +558,14 @@ _ic_process_key_event_reply_cb (gpointer data,
{
gboolean retval;
CallData *call_data;
-
IBusMessage *reply;
- BusInputContextPrivate *priv;
- priv = BUS_INPUT_CONTEXT_GET_PRIVATE (call_data->context);
retval = (gboolean) GPOINTER_TO_INT (data);
call_data = (CallData *) user_data;
+
+ BusInputContextPrivate *priv;
+ priv = BUS_INPUT_CONTEXT_GET_PRIVATE (call_data->context);
+
reply = ibus_message_new_method_return (call_data->message);
ibus_message_append_args (reply,
diff --git a/src/ibusconnection.c b/src/ibusconnection.c
index 4821d6d..acc9037 100644
--- a/src/ibusconnection.c
+++ b/src/ibusconnection.c
@@ -605,13 +605,16 @@ ibus_connection_send_with_reply_and_block (IBusConnection *connection,
connection_signals[IBUS_MESSAGE_SENT],
0,
message);
+ ibus_error_free (_error);
}
-
- if (reply == NULL && error != NULL) {
+ else {
+ if (error != NULL) {
*error = _error;
+ }
+ else {
+ ibus_error_free (_error);
+ }
}
- else
- ibus_error_free (_error);
return reply;
}
@@ -666,8 +669,9 @@ ibus_connection_call (IBusConnection *connection,
if (error) {
*error = tmp_error;
}
- else
+ else {
ibus_error_free (tmp_error);
+ }
ibus_message_unref (reply);
return FALSE;
}
@@ -676,7 +680,7 @@ ibus_connection_call (IBusConnection *connection,
type = first_arg_type;
- while (type != DBUS_TYPE_INVALID) {
+ while (type != G_TYPE_INVALID) {
va_arg (args, gpointer);
type = va_arg (args, GType);
}
@@ -685,16 +689,14 @@ ibus_connection_call (IBusConnection *connection,
if (type != G_TYPE_INVALID) {
retval = ibus_message_get_args_valist (reply, error, type, args);
}
-
- va_end (args);
-
- ibus_message_unref (reply);
-
- if (!retval) {
- return FALSE;
+ else {
+ retval = TRUE;
}
+
+ va_end (args);
+ ibus_message_unref (reply);
- return TRUE;
+ return retval;
}
void
diff --git a/src/ibusmessage.c b/src/ibusmessage.c
index 08457a3..0541778 100644
--- a/src/ibusmessage.c
+++ b/src/ibusmessage.c
@@ -424,7 +424,7 @@ ibus_message_get_args_valist (IBusMessage *message,
if (!retval) {
if (error) {
*error = ibus_error_new_from_printf (DBUS_ERROR_INVALID_ARGS,
- "Message does not have arguments!");
+ "Message does not have arguments!");
}
return FALSE;
}