Branch: refs/heads/webkitglib/2.52
  Home:   https://github.com/WebKit/WebKit
  Commit: 63a59c2297e1d41b110711e5e1e96213acaee31c
      
https://github.com/WebKit/WebKit/commit/63a59c2297e1d41b110711e5e1e96213acaee31c
  Author: Claudio Saavedra <[email protected]>
  Date:   2026-03-31 (Tue, 31 Mar 2026)

  Changed paths:
    M Source/WebKit/UIProcess/API/glib/IconDatabase.cpp

  Log Message:
  -----------
  Cherry-pick 310242@main (e284abe8a7fa). 
https://bugs.webkit.org/show_bug.cgi?id=311112

    [GLIB] WebKit::IconDatabase::~IconDatabase(): ASSERTION FAILED: 
isMainRunLoop()
    https://bugs.webkit.org/show_bug.cgi?id=311112

    Reviewed by Adrian Perez de Castro.

    The destructor for IconDatabase checks that it's being invoked from the 
main loop
    thread. But the many worker's lambdas in IconDatabase are capturing a 
strong reference
    to the object which, depending on timing, can be the last one alive,
    so that when the lambda goes out of scope, it can end up destroying the 
object from
    the worker thread and hitting the assertion in the destructor.

    This is particularly crashy for the worker lambda in 
IconDatabase::loadIconsForPageURL().
    We can fix this here by moving the protectedThis reference instead of 
creating a new one,
    that way the ownership of the reference goes back to the main loop thread.

    This needs to be fixed for other methods in this class, but we will do that
    in a subsequent patch as other lambda uses don't need to capture the icon
    database object so the fix can be different.

    * Source/WebKit/UIProcess/API/glib/IconDatabase.cpp:
    (WebKit::IconDatabase::loadIconsForPageURL):

    Canonical link: https://commits.webkit.org/310242@main

Canonical link: https://commits.webkit.org/305877.338@webkitglib/2.52



To unsubscribe from these emails, change your notification settings at 
https://github.com/WebKit/WebKit/settings/notifications

Reply via email to