mirror of
https://gitlab.winehq.org/wine/wine-gecko.git
synced 2024-09-13 09:24:08 -07:00
Bug 796184 - Revert UnixSocketImpl to a bare pointer, make Bluetooth*Managers use CloseSocket; r=cjones r=gyeh
--HG-- extra : rebase_source : fe8f4633eb9fb86ffc4a87e6b483b3357ab9896d
This commit is contained in:
parent
c8c29e0e1e
commit
0e56497b27
@ -202,7 +202,6 @@ BluetoothHfpManager::Get()
|
||||
NS_ENSURE_TRUE(manager, nullptr);
|
||||
|
||||
if (!manager->Init()) {
|
||||
manager->Cleanup();
|
||||
return nullptr;
|
||||
}
|
||||
|
||||
@ -334,7 +333,7 @@ BluetoothHfpManager::HandleShutdown()
|
||||
{
|
||||
MOZ_ASSERT(NS_IsMainThread());
|
||||
gInShutdown = true;
|
||||
Cleanup();
|
||||
CloseSocket();
|
||||
gBluetoothHfpManager = nullptr;
|
||||
return NS_OK;
|
||||
}
|
||||
|
@ -108,7 +108,6 @@ BluetoothScoManager::Get()
|
||||
NS_ENSURE_TRUE(manager, nullptr);
|
||||
|
||||
if (!manager->Init()) {
|
||||
manager->Cleanup();
|
||||
return nullptr;
|
||||
}
|
||||
|
||||
@ -142,7 +141,7 @@ BluetoothScoManager::HandleShutdown()
|
||||
{
|
||||
MOZ_ASSERT(NS_IsMainThread());
|
||||
gInShutdown = true;
|
||||
Cleanup();
|
||||
CloseSocket();
|
||||
gBluetoothScoManager = nullptr;
|
||||
return NS_OK;
|
||||
}
|
||||
|
@ -118,7 +118,8 @@ public:
|
||||
|
||||
void PrepareRemoval()
|
||||
{
|
||||
mConsumer.forget();
|
||||
mTask = nullptr;
|
||||
mCurrentTaskIsCanceled = true;
|
||||
}
|
||||
|
||||
/**
|
||||
@ -229,6 +230,7 @@ private:
|
||||
static void
|
||||
DestroyImpl(UnixSocketImpl* impl)
|
||||
{
|
||||
MOZ_ASSERT(impl);
|
||||
delete impl;
|
||||
}
|
||||
|
||||
@ -498,13 +500,15 @@ UnixSocketConsumer::CloseSocket()
|
||||
if (!mImpl) {
|
||||
return;
|
||||
}
|
||||
UnixSocketImpl* impl = mImpl;
|
||||
mImpl->mConsumer.forget();
|
||||
mImpl = nullptr;
|
||||
// To make sure the owner doesn't die on the IOThread, remove pointer here
|
||||
mImpl->PrepareRemoval();
|
||||
// Line it up to be destructed on the IO Thread
|
||||
// Kill our pointer to it
|
||||
XRE_GetIOMessageLoop()->PostTask(FROM_HERE,
|
||||
NewRunnableFunction(DestroyImpl,
|
||||
mImpl.forget()));
|
||||
impl));
|
||||
}
|
||||
|
||||
void
|
||||
|
@ -173,7 +173,7 @@ public:
|
||||
*/
|
||||
void CancelSocketTask();
|
||||
private:
|
||||
nsAutoPtr<UnixSocketImpl> mImpl;
|
||||
UnixSocketImpl* mImpl;
|
||||
};
|
||||
|
||||
} // namespace ipc
|
||||
|
Loading…
Reference in New Issue
Block a user