How to handle Out-of-Memory in Konqueror?
Rolf Magnus
ramagnus at kde.org
Wed Feb 25 12:59:02 GMT 2004
On Wednesday 25 February 2004 11:12, Luciano Montanaro wrote:
> > First thing: I will have to catch the exception? Or is it enough to check
> > for zero as return value from new() ?
>
> new always returns a valid pointer unless you use nothrow
Or unless - which is by default the case in KDE AFAIK - exceptions are
switched off through the compiler command line.
> (e.g. QString pippo = new(nothrow) QString(1000); will return 0 if the
> space can't be allocated.)
No, that will produce a compile error ;-)
And you don't really want to dynamically create QStrings.
More information about the kde-core-devel
mailing list