Static access to ICore

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


-----BEGIN PGP SIGNED MESSAGE-----
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.
- --
Matt


-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.7 (Darwin)

iD8DBQFHP7wqA6Vv5rghv0cRAvtWAJ9QGvI7ggCHl7D37NaQRQLP2OT2jgCgldGo
1zmwAz+LxeTj206LZ+bpiH0=
=pq4/
-----END PGP SIGNATURE-----




More information about the KDevelop-devel mailing list