Opened 16 years ago

Closed 16 years ago

Last modified 16 years ago

#1573 closed Bug (fixed)

OnSelectionChange fired when document is unloaded

Reported by: Matthias Miller Owned by: Martin Kou
Priority: Normal Milestone: FCKeditor 2.5
Component: General Version:
Keywords: Cc:

Description

The OnSelectionChange event is sometimes being fired in IE even when the document is unloaded. Most event handlers assume that a document is currently loaded.

The included patch works for me.

Attachments (1)

Doc_OnSelectionChange.patch (486 bytes) - added by Matthias Miller 16 years ago.

Download all attachments as: .zip

Change History (5)

Changed 16 years ago by Matthias Miller

Attachment: Doc_OnSelectionChange.patch added

comment:1 Changed 16 years ago by Alfonso Martínez de Lizarrondo

In #1498 (and some later dups) this problem was generating a crash in IE.

Besides this protection it might be a good idea to remove all the event listeners that are able to be fired even when the document is being destroyed, in a way similar to the FCK_Cleanup() but making sure that all the events that have been attached are removed, references to objects cleaned up (#1574) and the like, whenever the document is destroyed (due to switching modes or to unload of the page)

comment:2 Changed 16 years ago by Martin Kou

Owner: set to Martin Kou
Status: newassigned

comment:3 Changed 16 years ago by Martin Kou

Resolution: fixed
Status: assignedclosed

A listener cleanup logic would not eliminate all checks for FCK.EditorDocument and FCK.EditorWindow in all event handlers, because not all event handlers should be detached (e.g. click handlers of toolbar buttons) when the editor frame unloads. So I think putting sanity checks in the event handlers would be a better approach, and it is what is already done in many event handlers and functions called by event handlers (e.g. in the GetState() function of many commands). The current approach isn't perfect, as seen in this ticket, but putting things on cleanup wouldn't eliminate all potential problems either.

I've merged matthiasmiller's patch to trunk in [1122].

comment:4 Changed 16 years ago by Frederico Caldeira Knabben

Milestone: FCKeditor 2.5
Note: See TracTickets for help on using tickets.
© 2003 – 2022, CKSource sp. z o.o. sp.k. All rights reserved. | Terms of use | Privacy policy