more crashes...
Roland Krause
rokrau at yahoo.com
Tue Mar 13 23:27:17 UTC 2001
Hi Falk,
--- Falk Brettschneider <gigafalk at yahoo.com> wrote:
> Until today I haven't care about both slots. Other things were more
> important. For instance I replaced about 500 places where either
> cpp_widget
> or header_widget has been by the appropriate thingy of the
> DocViewMan... The
> architecture changed a bit but at many places.
> I think I will have a look at the save slots this day or tomorrow.
I'll try it out asap.
> > (m_docViewManager->currentEditView()->getName()).fileName()
> >
> > doesnt that lead to very instable code?
>
> m_docViewManager is always existing. Otherwise KDevelop crashes on
> startup, already.
Yes, but currentEditView() can return 0 and then your literally
screwed.
> If currentView() is valid, depends on if a document is open.
Yes but the slot _can_ be reached when there is no file. And even if
you wanted to change that it can also be reached by a "File->Save All"
which is what I do for example after I change Preferences, Options and
Settings.
> But some slots
> are only reached as result of interaction with such a view of a
> document. I
> suppose you found that line in such a slot. So we can take for
> granted that
> there's a current view. And every view has always got a filename or
> name,
No it has not, there is no soruce file, therefore the pointer is 0.
> default is "".
> So 3 extra pointer checks are quite useless here. We know the
> validity of
> architecture here and avoid to code overhead.
No. I disagree, as you can see it is quite easy to recreate that crash.
Disabling the slot is not the solution. Defensive programming is.
> I won't check a pointer for 0L in every case. As said some functions
> are
> never reached if the objects don't exist.
Sure, agreed.
Regards
Roland
=====
--
Roland Krause
In the garage of life there are mechanics and
there are drivers. Mechanics wanted!
__________________________________________________
Do You Yahoo!?
Yahoo! Auctions - Buy the things you want at great prices.
http://auctions.yahoo.com/
-
to unsubscribe from this list send an email to kdevelop-devel-request at kdevelop.org with the following body:
unsubscribe »your-email-address«
More information about the KDevelop-devel
mailing list