mirror of
https://github.com/lightpanda-io/browser.git
synced 2026-04-04 08:30:31 +00:00
fix crashes on cached file from script manager
This commit is contained in:
@@ -273,6 +273,10 @@ pub fn addFromElement(self: *ScriptManager, comptime from_parser: bool, script_e
|
|||||||
// Let the outer errdefer handle releasing the arena if client.request fails
|
// Let the outer errdefer handle releasing the arena if client.request fails
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// If we return synchronously (like from cache), we would call evaluate() immediately.
|
||||||
|
const was_evaluating = self.is_evaluating;
|
||||||
|
self.is_evaluating = true;
|
||||||
|
|
||||||
try self.client.request(.{
|
try self.client.request(.{
|
||||||
.url = url,
|
.url = url,
|
||||||
.ctx = script,
|
.ctx = script,
|
||||||
@@ -290,6 +294,9 @@ pub fn addFromElement(self: *ScriptManager, comptime from_parser: bool, script_e
|
|||||||
.done_callback = Script.doneCallback,
|
.done_callback = Script.doneCallback,
|
||||||
.error_callback = Script.errorCallback,
|
.error_callback = Script.errorCallback,
|
||||||
});
|
});
|
||||||
|
|
||||||
|
self.is_evaluating = was_evaluating;
|
||||||
|
|
||||||
handover = true;
|
handover = true;
|
||||||
|
|
||||||
if (comptime IS_DEBUG) {
|
if (comptime IS_DEBUG) {
|
||||||
|
|||||||
Reference in New Issue
Block a user