mirror of
https://github.com/mozilla/gecko-dev.git
synced 2024-11-25 05:41:12 +00:00
Bug 1266054: GTK+: Hold references to |DBusPendingCall| in |RefPtr|, r=karlt
MozReview-Commit-ID: F5jb9tR5FGa
This commit is contained in:
parent
e4b9259642
commit
4e5a56e843
@ -13,6 +13,7 @@
|
||||
#include <dbus/dbus-glib-lowlevel.h>
|
||||
|
||||
#include "mozilla/ipc/DBusMessageRefPtr.h"
|
||||
#include "mozilla/ipc/DBusPendingCallRefPtr.h"
|
||||
|
||||
#define FREEDESKTOP_SCREENSAVER_TARGET "org.freedesktop.ScreenSaver"
|
||||
#define FREEDESKTOP_SCREENSAVER_OBJECT "/ScreenSaver"
|
||||
@ -81,15 +82,15 @@ bool
|
||||
WakeLockTopic::SendMessage(DBusMessage* aMessage)
|
||||
{
|
||||
// send message and get a handle for a reply
|
||||
DBusPendingCall* reply;
|
||||
dbus_connection_send_with_reply(mConnection, aMessage, &reply,
|
||||
RefPtr<DBusPendingCall> reply;
|
||||
dbus_connection_send_with_reply(mConnection, aMessage,
|
||||
reply.StartAssignment(),
|
||||
DBUS_TIMEOUT);
|
||||
if (!reply) {
|
||||
return false;
|
||||
}
|
||||
|
||||
dbus_pending_call_set_notify(reply, &ReceiveInhibitReply, this, NULL);
|
||||
dbus_pending_call_unref(reply);
|
||||
|
||||
return true;
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user