I'm currently looking into a problem that happens when you delete my
InsetGraphics when a dialog is open. The scenario is as follows:
1. Insert InsetGraphics
2. Edit it (the dialog pops)
3. Go back to LyX and delete the inset (the dialog stays)
4. Edit the dialog and click apply (LyX crashes)
You probably can't do it at home since my Inset is not commited anywhere,
but the reason is that my inset requires knowing who the calling inset was
so I have a pointer to the inset, now if the inset got deleted, my pointer
points to nowhere particular.
The solution to this is to make the dialog hide when the inset it
currently works for gets deleted. This is nice in theory, however I can't
get a way to send the signal from my destructor due to the fact that I do
no hold a pointer to BufferView, Buffer or LyXView in my class.
A generic solution for all such insets (apparently the insetcitation has a
similar problem), is to have another signal hideInsetDialog(Inset*) to
which every dialog can connect and whenever an inset is deleted
(preferably before it gets deleted) the signal will be issued, this will
hide the dialog if there is a dialog associated with this inset.
In my opinion this is the cleanest solution to the problem. I would have
implemented it if I could find where the insets get deleted, I can't find
my hands and legs in the LyX core. (which is why I work on an inset).
--
Baruch Even
http://techst02.technion.ac.il/~sbaruch/ (My Site)
http://rpghost.com/jindor/ (My brothers AD&D site)
" Learn to laugh ... it's the path to true love! "
- The Angel in the movie Michael