From 274701320140da3c607a069c9f91ee80166cbd59 Mon Sep 17 00:00:00 2001 From: abose Date: Tue, 18 Aug 2026 14:54:40 +0530 Subject: [PATCH 1/2] fix(live-preview): release LiveHTMLDocument's doc ref when file is deleted LiveHTMLDocument holds its own addRef() on the doc it's previewing, on top of any editor's ref, but only released it from close() - which is driven by the live preview session lifecycle, not by the file disappearing. Deleting the actively-previewed HTML file from the file tree left that ref dangling forever. Mirrors LiveCSSDocument's existing "deleted" handling, which already does this correctly. --- .../documents/LiveHTMLDocument.js | 17 +++++++++++++++++ 1 file changed, 17 insertions(+) diff --git a/src/LiveDevelopment/MultiBrowserImpl/documents/LiveHTMLDocument.js b/src/LiveDevelopment/MultiBrowserImpl/documents/LiveHTMLDocument.js index 9686ad405c..195e11c444 100644 --- a/src/LiveDevelopment/MultiBrowserImpl/documents/LiveHTMLDocument.js +++ b/src/LiveDevelopment/MultiBrowserImpl/documents/LiveHTMLDocument.js @@ -61,6 +61,9 @@ define(function (require, exports, module) { this._onChange = this._onChange.bind(this); this.doc.on("change", this._onChange); + this._onDeleted = this._onDeleted.bind(this); + this.doc.on("deleted", this._onDeleted); + this._onRelated = this._onRelated.bind(this); this.protocol.on("DocumentRelated", this._onRelated); @@ -152,6 +155,7 @@ define(function (require, exports, module) { LiveHTMLDocument.prototype.close = function () { this.doc.releaseRef(); this.doc.off("change", this._onChange); + this.doc.off("deleted", this._onDeleted); this.protocol.off("DocumentRelated", this._onRelated); this.protocol.off("StylesheetAdded", this._onStylesheetAdded); this.protocol.off("StylesheetRemoved", this._onStylesheetRemoved); @@ -161,6 +165,19 @@ define(function (require, exports, module) { this.parentClass.close.call(this); }; + /** + * @private + * Handles the backing Document's file being deleted from disk (eg. from the file tree). + * Without this, our extra addRef() on the doc (on top of any editor's own ref) would never + * be released - close() is otherwise only called by the live preview session lifecycle, not + * in response to the file disappearing. + * @param {$.Event} event + */ + LiveHTMLDocument.prototype._onDeleted = function (event) { + this.close(); + this.trigger("deleted", [this]); + }; + /** * @override * Update the highlights in the browser based on the cursor position. From a76b0d46baca8ddad2e39ef9156a2e1f64a32664 Mon Sep 17 00:00:00 2001 From: abose Date: Tue, 18 Aug 2026 14:57:16 +0530 Subject: [PATCH 2/2] build: update pro deps --- tracking-repos.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tracking-repos.json b/tracking-repos.json index ef018a171e..68790e87f3 100644 --- a/tracking-repos.json +++ b/tracking-repos.json @@ -1,5 +1,5 @@ { "phoenixPro": { - "commitID": "f07435fe2714e57ca69f49634255aee36b4802ca" + "commitID": "a69d2ed60ccb04bd245508fb2b4df943d2f43cfa" } }