Patch: Crash: blocking JS alert and deleting a window

David Faure david at mandrakesoft.com
Mon Oct 28 12:55:09 GMT 2002


-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

On Sunday 27 October 2002 14:04, Koos Vriezen wrote:
> On Sun, 27 Oct 2002, David Faure wrote:
> > Yes. We can't change the destruction mechanism of KParts.
> > However all we want here is to call closeChildDialogs() at the right time....
> > I'm not fully seeing the problem here. Both ~KHTMLView and ~KHTMLPart
> > call closeChildDialogs. Hmm, maybe ~KHTMLPart should simply call it earlier?
> > As long as we close the dialog before destroying anything else it might return to
> > (i.e. KHTML's part, view, DOM tree, JS stuff etc.), it should be fine, no?
> 
> But again if we cannot control the destruction of KHTMLPart we're
> lost. ~KHTMLPart is obviously too late for closing dialogs 
>
> Ok, to summarize:
> - KHTMLPart must be informed before destruction, where it can call
>   closeChildDialogs()
> - Some kind of reschedule, postEvent/deleteLater/timer, to allow the stack
>   popping out of the dialog message loop.

Doesn't it pop up immediately, with my new KDialogBase::cancel() call?
... much later, after doing some testing ...
Ah, indeed it doesn't. exit_loop only sets a bool, it will only be used when
the control goes back to the event loop.

I agree with your summary then....

Looking at the last patch, the one with EventFilterer..... 
The goal is to get the CloseEvent of the mainwindow, but due
to the reparenting, you can't get hold of the mainwindow when
the htmlview is created, right? (hence all that code with the
Reparent event etc.)

This is why I was thinking of something slightly different:
a new kind of event, which we'd define ourselves (like those defined
in kparts/event.h). This event would be sent to konqueror's
parts before destroying them.
Hmm, I guess we could also simply send a CloseEvent, if Qt
doesn't do it for non-toplevel-widgets?
The point is that we could then simply write KHTMLView::closeEvent()
instead of having to create an event filterer.

- -- 
David FAURE, david at mandrakesoft.com, faure at kde.org
http://people.mandrakesoft.com/~david/
Contributing to: http://www.konqueror.org/, http://www.koffice.org/
Get the latest KOffice - http://download.kde.org/stable/koffice-1.2/
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.0.7 (GNU/Linux)

iD8DBQE9vTOu72KcVAmwbhARAu5/AJ92iT8hRKGq4qBR99XOmixQe2/ahwCfVQ4C
Rdehz1BcpZYFssgCIJSNVQ4=
=M0W3
-----END PGP SIGNATURE-----





More information about the kfm-devel mailing list