Skip to content

Commit

Permalink
Bug 1876536 - Part 2: Remove self refcounts within constructor in Ima…
Browse files Browse the repository at this point in the history
…geBitmap r=gfx-reviewers,lsalzman

Differential Revision: https://phabricator.services.mozilla.com/D199978
  • Loading branch information
saschanaz committed Feb 1, 2024
1 parent 7b236d5 commit 139143f
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion dom/canvas/ImageBitmap.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -81,7 +81,7 @@ class SendShutdownToWorkerThread : public MainThreadWorkerControlRunnable {
*/
class ImageBitmapShutdownObserver final : public nsIObserver {
public:
explicit ImageBitmapShutdownObserver() {
void Init() {
sShutdownMutex.AssertCurrentThreadOwns();
if (NS_IsMainThread()) {
RegisterObserver();
Expand Down Expand Up @@ -649,6 +649,7 @@ ImageBitmap::ImageBitmap(nsIGlobalObject* aGlobal, layers::Image* aData,
if (!sShutdownObserver &&
!AppShutdown::IsInOrBeyond(ShutdownPhase::XPCOMShutdown)) {
sShutdownObserver = new ImageBitmapShutdownObserver();
sShutdownObserver->Init();
}
if (sShutdownObserver) {
mShutdownRunnable = sShutdownObserver->Track(this);
Expand Down

0 comments on commit 139143f

Please sign in to comment.