mirror of
https://repo.dactyloidae.xyz/Dactyloidae/UXP.git
synced 2026-09-04 06:48:38 +09:00
[DOM] Store weak pointer to next parents.
This commit is contained in:
parent
8630e4f6dc
commit
202ef2a56a
2 changed files with 13 additions and 4 deletions
|
|
@ -9,6 +9,7 @@
|
|||
#include "mozilla/ipc/BackgroundParent.h"
|
||||
#include "mozilla/StaticPtr.h"
|
||||
#include "mozilla/Unused.h"
|
||||
#include "mozilla/WeakPtr.h"
|
||||
#include "nsTArray.h"
|
||||
|
||||
using mozilla::ipc::AssertIsOnBackgroundThread;
|
||||
|
|
@ -59,7 +60,7 @@ public:
|
|||
{
|
||||
uint32_t mSequenceID;
|
||||
// MessagePortParent keeps the service alive, and we don't want a cycle.
|
||||
MessagePortParent* mParent;
|
||||
WeakPtr<MessagePortParent> mParent;
|
||||
};
|
||||
|
||||
FallibleTArray<NextParent> mNextParents;
|
||||
|
|
@ -275,9 +276,13 @@ MessagePortService::CloseAll(const nsID& aUUID, bool aForced)
|
|||
data->mParent->Close();
|
||||
}
|
||||
|
||||
for (const MessagePortServiceData::NextParent& parent : data->mNextParents) {
|
||||
parent.mParent->CloseAndDelete();
|
||||
for (const MessagePortServiceData::NextParent& nextParent : data->mNextParents) {
|
||||
MessagePortParent* const parent = nextParent.mParent;
|
||||
if (parent) {
|
||||
parent->CloseAndDelete();
|
||||
}
|
||||
}
|
||||
data->mNextParents.Clear();
|
||||
|
||||
nsID destinationUUID = data->mDestinationUUID;
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue