#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)
Change History (5)
Changed 17 years ago by
Attachment: | Doc_OnSelectionChange.patch added |
---|
comment:1 Changed 17 years ago by
comment:2 Changed 17 years ago by
Owner: | set to Martin Kou |
---|---|
Status: | new → assigned |
comment:3 Changed 17 years ago by
Resolution: | → fixed |
---|---|
Status: | assigned → closed |
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 17 years ago by
Milestone: | → FCKeditor 2.5 |
---|
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)