Some Eclipse Foundation services are deprecated, or will be soon. Please ensure you've read this important communication.

Bug 364092

Summary: Some stylers not cleaned up when file input changes
Product: [ECD] Orion Reporter: Mark Macdonald <mamacdon>
Component: ClientAssignee: Project Inbox <orion.client-inbox>
Status: RESOLVED FIXED QA Contact:
Severity: normal    
Priority: P3    
Version: 0.3   
Target Milestone: 0.4 M1   
Hardware: PC   
OS: Windows 7   
Whiteboard:

Description Mark Macdonald CLA 2011-11-17 18:00:22 EST
Orion 0.3

1. Open an HTML file in the editor.
2. Press Ctrl+Shift+R, type in the name of some other file dialog, then click on one of the results.
3. The editor will load the file you clicked. However, there's also a TypeError generated:

> TypeError
>   arguments: Array[2]
>     0: "destroy"
>     1: TextMateStyler
>   type: "undefined_method"

This is from the editor trying to destroy the old styler. It fails because TextMateStyler doesn't implement destroy(). This leaks 1 TextMateStyler instance each time.

All the stylers must implement destroy(). Listening to a "Destroy" event on the underlying TextView is not enough, because the editor reuses a single TextView as different files are loaded.
Comment 1 Mark Macdonald CLA 2011-11-17 18:03:03 EST
http://git.eclipse.org/c/orion/org.eclipse.orion.client.git/commit/?id=72c5cb8d4f7871a1716e794822b923906a3b5eea

Also fixed a bug where one styler was not removing its listeners correctly.