Bug 1125030 - Handle VsyncChild shutdown in ActorDestroy(). r=bent
This commit is contained in:
@@ -190,7 +190,10 @@ BackgroundChildImpl::DeallocPFileDescriptorSetChild(
|
||||
BackgroundChildImpl::PVsyncChild*
|
||||
BackgroundChildImpl::AllocPVsyncChild()
|
||||
{
|
||||
return new mozilla::layout::VsyncChild();
|
||||
nsRefPtr<mozilla::layout::VsyncChild> actor = new mozilla::layout::VsyncChild();
|
||||
// There still has one ref-count after return, and it will be released in
|
||||
// DeallocPVsyncChild().
|
||||
return actor.forget().take();
|
||||
}
|
||||
|
||||
bool
|
||||
@@ -198,7 +201,9 @@ BackgroundChildImpl::DeallocPVsyncChild(PVsyncChild* aActor)
|
||||
{
|
||||
MOZ_ASSERT(aActor);
|
||||
|
||||
delete static_cast<mozilla::layout::VsyncChild*>(aActor);
|
||||
// This actor already has one ref-count. Please check AllocPVsyncChild().
|
||||
nsRefPtr<mozilla::layout::VsyncChild> actor =
|
||||
dont_AddRef(static_cast<mozilla::layout::VsyncChild*>(aActor));
|
||||
return true;
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user