Skip to content

Conversation

@dvoituron
Copy link
Collaborator

[FluentDesignTheme] Assertion failed "heap is currently locked when changing theme"

Like describe in this issue: #1182
this error may occur when the user changes Theme using FluentDesignTheme

image

SteveSandersonMS replied with this anwser.

What's happening here is that your JS code is trying to call back into .NET during the middle of applying a renderbatch
to the DOM. This isn't safe to do, because if .NET code runs at this time, it might modify the contents of .NET memory
and invalidate the renderbatch that's still being processed.

To avoid this problem, when performing JS interop calls that can occur while applying a renderbatch, be sure to defer
the call. For example, update your code as follows:

   window.document.addEventListener("focusout", function (e) {
       console.log("focus out: " + new Date());

       if (e.target.classList.contains("list-item-1")) {
           setTimeout(invokeFocusOut, 0);
       }
   });

@github-actions
Copy link

Azure Static Web Apps: Your stage site is ready! Visit it here: https://black-pebble-0dc79cb03-1419.westeurope.3.azurestaticapps.net

@vnbaaij vnbaaij enabled auto-merge (squash) January 31, 2024 18:49
@github-actions
Copy link

Azure Static Web Apps: Your stage site is ready! Visit it here: https://black-pebble-0dc79cb03-1419.westeurope.3.azurestaticapps.net

@vnbaaij vnbaaij merged commit f02921f into dev Jan 31, 2024
@vnbaaij vnbaaij deleted the users/dvoituron/fix-heap-currently-locked branch January 31, 2024 18:53
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants