[haiku-commits] Re: r39678 - in haiku/trunk/src/libs: alm linprog

  • From: "Clemens Zeidler" <clemens.zeidler@xxxxxxxxxxxxxx>
  • To: haiku-commits@xxxxxxxxxxxxx
  • Date: Tue, 30 Nov 2010 10:11:47 +1300

Am 30.11.2010, 09:49 Uhr, schrieb Rene Gollent <anevilyak@xxxxxxxxx>:

On Mon, Nov 29, 2010 at 3:46 PM,  <clemens.zeidler@xxxxxxxxxxxxxx> wrote:
@@ -127,7 +127,7 @@
 Row*
 BALMLayout::AddRow(YTab* top, YTab* bottom)
 {
-       Row* row = new Row(this);
+       Row* row = new(std::nothrow) Row(this);
       if (top != NULL)
               row->Constraints()->AddItem(row->Top()->IsEqual(top));

Thngs like this need to check if the resulting object is NULL or not
if you're going to use nothrow. Many places in this diff simply assume
it's going to succeed and will crash if it doesn't.,

yes I know... :(

Regards,
        Clemens

Other related posts: