Skip to content
This repository was archived by the owner on Dec 15, 2022. It is now read-only.
This repository was archived by the owner on Dec 15, 2022. It is now read-only.

Uncaught Error: This TextEditor has been destroyed #122

Closed

Description

@fpcorso

I am not too entirely sure what I did to cause this but I had switched git branches for the project I was working on which caused the files I had open to be older versions. I went to close all tabs but a message popped up asking to save, don't save, or cancel. I had 9 files open and quickly clicked "Don't Save" through all of them which resulted in 2 of these errors below. I have been unable to replicate it but thought I would create the issue as the error told me to.

Atom Version: 0.186.0
System: linux 3.2.0-51-generic
Thrown From: tabs package, v0.67.0

Stack Trace

Uncaught Error: This TextEditor has been destroyed

At /usr/share/atom/resources/app/src/display-buffer.js:1005

Error: This TextEditor has been destroyed
  at DisplayBuffer.module.exports.DisplayBuffer.screenPositionForBufferPosition (/usr/share/atom/resources/app/src/display-buffer.js:1005:15)
  at DisplayBuffer.module.exports.DisplayBuffer.screenRangeForBufferRange (/usr/share/atom/resources/app/src/display-buffer.js:870:20)
  at Marker.module.exports.Marker.getScreenRange (/usr/share/atom/resources/app/src/marker.js:173:33)
  at Selection.module.exports.Selection.getScreenRange (/usr/share/atom/resources/app/src/selection.js:95:26)
  at Selection.module.exports.Selection.finalize (/usr/share/atom/resources/app/src/selection.js:889:76)
  at TextEditor.module.exports.TextEditor.finalizeSelections (/usr/share/atom/resources/app/src/text-editor.js:2132:33)
  at /usr/share/atom/resources/app/src/text-editor-component.js:750:24
  at EventEmitter.ipc.sendSync (/usr/share/atom/resources/atom/renderer/api/lib/ipc.js:21:31)
  at Object.RemoteMemberFunction [as showMessageBox] (/usr/share/atom/resources/atom/renderer/api/lib/remote.js:110:29)
  at Atom.module.exports.Atom.confirm (/usr/share/atom/resources/app/src/atom.js:706:23)
  at Pane.module.exports.Pane.promptToSaveItem (/usr/share/atom/resources/app/src/pane.js:507:21)
  at Pane.module.exports.Pane.destroyItem (/usr/share/atom/resources/app/src/pane.js:456:18)
  at TabBarView.module.exports.TabBarView.closeTab (/usr/share/atom/resources/app/node_modules/tabs/lib/tab-bar-view.js:285:24)
  at TabBarView.module.exports.TabBarView.closeAllTabs (/usr/share/atom/resources/app/node_modules/tabs/lib/tab-bar-view.js:360:28)
  at space-pen-ul.subscriptions.add.atom.commands.add.tabs:close-all-tabs (/usr/share/atom/resources/app/node_modules/tabs/lib/tab-bar-view.js:67:26)
  at CommandRegistry.module.exports.CommandRegistry.handleCommandEvent (/usr/share/atom/resources/app/src/command-registry.js:243:29)
  at CommandRegistry.handleCommandEvent (/usr/share/atom/resources/app/src/command-registry.js:3:61)
  at CommandRegistry.module.exports.CommandRegistry.dispatch (/usr/share/atom/resources/app/src/command-registry.js:156:19)
  at [object Object].jQuery.fn.trigger (/usr/share/atom/resources/app/src/space-pen-extensions.js:64:23)
  at EventEmitter.<anonymous> (/usr/share/atom/resources/app/src/window-event-handler.js:80:67)
  at EventEmitter.emit (events.js:119:17)
  at EventEmitter.ipc.sendSync (/usr/share/atom/resources/atom/renderer/api/lib/ipc.js:21:31)
  at BrowserWindow.RemoteMemberFunction [as emit] (/usr/share/atom/resources/atom/renderer/api/lib/remote.js:110:29)
  at ContextMenuManager.module.exports.ContextMenuManager.showForEvent (/usr/share/atom/resources/app/src/context-menu-manager.js:169:33)
  at HTMLDocument.<anonymous> (/usr/share/atom/resources/app/src/window-event-handler.js:153:33)
  at HTMLDocument.handler (/usr/share/atom/resources/app/src/space-pen-extensions.js:112:34)
  at HTMLDocument.jQuery.event.dispatch (/usr/share/atom/resources/app/node_modules/space-pen/vendor/jquery.js:4681:9)
  at HTMLDocument.elemData.handle (/usr/share/atom/resources/app/node_modules/space-pen/vendor/jquery.js:4359:46)

Commands

  2x -7:25.5 core:paste (atom-text-editor.editor.is-focused)
     -7:23.8 core:undo (atom-text-editor.editor.is-focused)
     -7:22.1 core:backspace (atom-text-editor.editor.is-focused)
     -7:19.9 core:paste (atom-text-editor.editor.is-focused)
  2x -7:18.5 core:save (atom-text-editor.editor.is-focused)
     -7:08.1 core:select-all (atom-text-editor.editor)
     -7:07.8 core:copy (atom-text-editor.editor)

Config

{
  "core": {
    "themes": [
      "seti-ui",
      "seti-syntax"
    ]
  }
}

Installed Packages

# User
autocomplete-plus, v2.4.2
color-picker, v1.4.4
git-log, v0.3.0
less-autocompile, v1.0.0
linter, v0.12.0
linter-less, v0.3.1
linter-php, v0.0.11
minimap, v4.6.0
seti-syntax, v0.3.3
seti-ui, v0.6.3

# Dev
No dev packages

Activity

  1. izuzak commented on May 13, 2015

    @izuzak
    Contributor

    Thanks for reporting this, @fpcorso. I've been trying to reproduce this as well but wasn't able to.

    @nathansobo do you maybe see something in the stack trace which might indicate a problem? I see that "Close All Tabs" was called (which destroys all tabs and text editors, I'm guessing) and somehow one of those also triggered a call which ended up in a destroyed text editor? 👴

  2. nathansobo commented on May 13, 2015

    @nathansobo
    Contributor

    @izuzak From the stack trace here is what I can infer:

    • The "Close All Tabs" command was run from the context menu after right clicking on a tab.
    • There was a modified file that was prompted to be saved.
    • Somehow the mouse up event was triggered on the text editor component after the confirmation dialog. It was at this moment that the editor was already destroyed and threw an error when trying to finalize selections.

    Perhaps we could guard the mouse up handler to only proceed if the editor is still alive? I tried a few times to reproduce but was unable to as well. Seems like some strange interaction with event order.

  3. gmarketer commented on Aug 18, 2015

    @gmarketer

    Got that error via 'Close All Tabs' command and fast clicking on 'Do not save button'.

  4. winstliu commented on Dec 12, 2018

    @winstliu
    Contributor

    No further reports.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions