-
Notifications
You must be signed in to change notification settings - Fork 7.6k
Document's refCount is no longer reliably correct #12396
Comments
It all boils down to this check: brackets/src/editor/EditorManager.js Line 548 in 76f3f99
As the pane id is not set, a new full editor with the same document is being created, which increases the refCount; but that refCount is not decreased to 0 afterwards |
Nice job debugging the cause @marcelgerber 👍 |
Great job @marcelgerber 👍 |
Good job @marcelgerber. Let us target this for 1.7. |
@marcelgerber @petetnt This problem should be resolved by #12405. |
I am deeply sorry, but I have to reopen this. |
@marcelgerber I just saw the error but really confused about the resolution of the problem. The expectation in our actual code is that when a document is getting opened explicitly in current active pane, we do call addView. I will try to debug our code in the actual scenario and see if the test itself needs to be updated. Edit Can confirm, this particular test has to be updated as the created editor using SpecRunnerUtils.createEditorInstance is never added to the pane , hence when we try to show it , we are going to call addView. One alternate is that we add the pane.addView call in SpecRunnerUtils.createEditorInstance itself , but then again the test will fail if we don't modify it. Following points are resolution options...
@marcelgerber @petetnt @nethip What do you think guys ? |
@swmitra I think if I understand it right, because the semantics have now changed, we need to update the test cases. But do analyze and see if it is going to effect extensions. |
#12439 resolves the reported issue as well as 4 more failing tests in MainViewManager. |
SpecRunnerUtils.js
DocumentManager = require("document/DocumentManager")
andDocumentManager.getAllOpenDocuments()
(supposed to only output one document - SpecRunnerUtils; otherwise, restart Brackets)_notifyActiveEditorChanged
and pressCtrl + E
to invoke an inline editorDocumentManager.getAllOpenDocuments()
now includes a second document - EditorManager - with a_refCount
of 3DocumentManager.getAllOpenDocuments()
's entry for EditorManager has a_refCount
of 5 nowCtrl + W
to close the full editorDocumentManager.getAllOpenDocuments()
's entry for EditorManager has a_refCount
of 4 nowDocumentManager.getAllOpenDocuments()
's entry for EditorManager has a_refCount
of 1 nowResult:
On current master, the
_refCount
of that document, where notably no editor exists any longer, is still 1, which means this document is not gonna get destroyedExpected:
As it is on ebd613b,
_refCount
should go down to 0, which means the document will self-destroyThis is the reason for some of the current test failures. I know it makes the UrlCodeHints tests fail, but I suppose it has broader impact.
This is caused by ffa298c, part of #11820
cc @swmitra @nethip @petetnt
The text was updated successfully, but these errors were encountered: