mirror of
https://gitlab.winehq.org/wine/wine-gecko.git
synced 2024-09-13 09:24:08 -07:00
Bug 1132229: Return in Dispatch method if Bluetooth runnable is nullptr, r=shuang
With this patch, the dispatch method of Bluetooth runnables simply returns if the supplied runnable is nullptr. This makes is easy to handle cases where the caller of a Bluetooth interface method is not interested in the result.
This commit is contained in:
parent
cfe2b0b4b0
commit
33620bd78f
@ -49,6 +49,9 @@ public:
|
||||
static void
|
||||
Dispatch(Obj* aObj, Res (Obj::*aMethod)(), const InitOp& aInitOp)
|
||||
{
|
||||
if (!aObj) {
|
||||
return; // silently return if no result runnable has been given
|
||||
}
|
||||
nsRefPtr<SelfType> runnable = Create(aObj, aMethod, aInitOp);
|
||||
if (!runnable) {
|
||||
BT_LOGR("BluetoothResultRunnable0::Create failed");
|
||||
@ -108,6 +111,9 @@ public:
|
||||
static void
|
||||
Dispatch(Obj* aObj, Res (Obj::*aMethod)(Arg1), const InitOp& aInitOp)
|
||||
{
|
||||
if (!aObj) {
|
||||
return; // silently return if no result runnable has been given
|
||||
}
|
||||
nsRefPtr<SelfType> runnable = Create(aObj, aMethod, aInitOp);
|
||||
if (!runnable) {
|
||||
BT_LOGR("BluetoothResultRunnable1::Create failed");
|
||||
@ -174,6 +180,9 @@ public:
|
||||
Dispatch(Obj* aObj, Res (Obj::*aMethod)(Arg1, Arg2, Arg3),
|
||||
const InitOp& aInitOp)
|
||||
{
|
||||
if (!aObj) {
|
||||
return; // silently return if no result runnable has been given
|
||||
}
|
||||
nsRefPtr<SelfType> runnable = Create(aObj, aMethod, aInitOp);
|
||||
if (!runnable) {
|
||||
BT_LOGR("BluetoothResultRunnable3::Create failed");
|
||||
|
Loading…
Reference in New Issue
Block a user