[bt-devel] close presenter bug

Joachim Ansorg bt-devel@crosswire.org
Mon, 11 Jun 2001 07:42:41 +0200


Hi Kevin!

You are really good in fixing bugs!
I upgraded to SuSE 7.2 and I have the same problem now.

I think this is caused because "delete this" is not safe.
In the Qt documentation you can read that QWidget::close deletes the widget 
if QDestructiveClose is set in the Widget flags.

Now we do not set the QDestructiveClose flag and emit a signal 
"closePresenter(this)" 
in a presenter (done in CPresenter::closeEvent()).

This signal is connected to CMDIArea::closePresenter,


With your help I was able to fix this very fast. Thank you!
After 1.0 development will speed up with the help of all volunteers.

Joachim

> I am running kde 2.1.2 from debian packages and qt 2.2.3 also
>
> >from debian package.  I already did an --enable-debug build as
>
> that is how I was able to come up with the fix that I mentioned.
> The line that dies is the close call in any of the three
> presenters in the modulesChanged method.  The method checks to
> see if there is any remaining modules open for that window and if
> not calls close(), which is where the failure occurs--inside this
> method which must come from either one of the kde or qt ancestors
> of the class as I saw no such method defined in any of the
> presenter classes/subclasses.
>
> --- void CBiblePresenter::modulesChanged(){
> ---   m_moduleList = m_moduleChooserBar->getModuleList();
> ---   if (!m_moduleList.count())
> --->  	close();  //*** Dies in this call ****
> ---   else {
> ---     refreshFeatures();
> ---     m_key->module(m_moduleList.first());
> ---	m_keyChooser->setModule(m_moduleList.first());
> ---	lookup(m_key);
> ---   }
> --- }