User forums > Using Code::Blocks

Kubuntu - C::B 8477 crash on Workspace load

<< < (4/4)

oBFusCATed:
I would probably use something like:

--- Code: ---A *a=func();
shared_ptr<B> p(a ? a->makeB() : nullptr);
if (p)
   ...

--- End code ---

Another option is:

--- Code: ---shared_ptr<B> p(nullptr);
A *a=func();
if (a)
    p=shared_ptr<B>(a->makeB());
if (p)

--- End code ---

MortenMacFly:

--- Quote from: oBFusCATed on October 29, 2012, 11:25:50 pm ---
--- Code: ---A *a=func();
shared_ptr<B> p(a ? a->makeB() : nullptr);
if (p)
   ...

--- End code ---

--- End quote ---
This looks like I did it, except that I used 0 and not nullptr, right? Then ti should be OK to commit to resolve the crash.

cacb:
Nice work, it is much appreciated!  :D

oBFusCATed:
Morten: yes, if it compiles and fixes the crash :)

cacb:
I have now upgraded to the latest C::B 8500 nightly under Kubuntu and can confirm that the crash problem is gone, also with CodeCompletion plugin enabled.

Thanks, guys.  :)

Navigation

[0] Message Index

[*] Previous page

Go to full version