[prev in list] [next in list] [prev in thread] [next in thread]
List: kde-core-devel
Subject: Re: How to handle Out-of-Memory in Konqueror?
From: Luciano Montanaro <mikelima () virgilio ! it>
Date: 2004-02-25 14:10:37
Message-ID: 200402251510.37620.mikelima () virgilio ! it
[Download RAW message or body]
On Wednesday 25 February 2004 13:59, Rolf Magnus wrote:
> 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.
I suppose that is the case, but I have not verified it.
>
> > (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.
>
Ok, I have chosen the wrong example and didn't really check what I was writing.
I'll be crucified in the canteen for that! :)
Luciano
[prev in list] [next in list] [prev in thread] [next in thread]
Configure |
About |
News |
Add a list |
Sponsored by KoreLogic