Static access to ICore

Matt Rogers mattr at
Sun Nov 18 04:14:34 UTC 2007

Hash: SHA1

On Nov 16, 2007, at 3:11 PM, Andreas Pakulat wrote:

> On 16.11.07 21:03:43, Esben Mose Hansen wrote:
>> On Friday 16 November 2007 19:35:06 Andreas Pakulat wrote:
>>> Huh? Ok, the constructor check would help if one could directly  
>>> create
>>> an ICore object, but the destructor check doesn't help with  
>>> anything, if
>>> instance != it gets set to 0, if it already is 0, well nothing  
>>> happens
>>> in the end.
>> Well, as I presume that only one instance is ever created, that  
>> check is
>> almost free and would catch the rather fatal bug if it was created  
>> twice.
>> Likewise with the destructor: While unlikely, the check is nearly  
>> free (could
>> be an assert, even) and is a nice sanity check. I admit I might be  
>> too
>> paranoid there. Blame my IT career ;)
> Hehe, I just added the assert to the constructor, indeed that check is
> quite cheap and doesn't really hurt.
> Andreas

Does it have to be an assert? Not nice to have a program crash before  
we've even seen the UI. I'm assuming of course that an instance of  
Core gets created before any UI is shown.
- --

Version: GnuPG v1.4.7 (Darwin)


More information about the KDevelop-devel mailing list