Planet
navi homePPSaboutscreenshotsdownloaddevelopmentforum

Ignore:
Timestamp:
Sep 9, 2015, 4:10:21 PM (9 years ago)
Author:
landauf
Message:

removed the 'bAddRef' argument from StrongPtr's constructor. it was a bad hack and shouldn't be used. in fact, it was only used to avoid recursive dependencies if one of the four base objects (Namespace, Level, Gametype, Scene) referenced itself with a StrongPtr.
instead of the 'bAddRef'-hack BaseObject now stores the references in a new construct called StrongOrWeakPtr which can either store the reference in a StrongPtr (like it did before) or in a WeakPtr (which is a cleaner alternative to 'bAddRef=true')

File:
1 edited

Legend:

Unmodified
Added
Removed
  • code/branches/core7/src/libraries/core/Namespace.cc

    r10562 r10578  
    4747        RegisterObject(Namespace);
    4848
    49         this->setNamespace(StrongPtr<Namespace>(this, false));
     49        this->setNamespace(WeakPtr<Namespace>(this)); // store a weak-pointer to itself (a strong-pointer would create a recursive dependency)
    5050    }
    5151
Note: See TracChangeset for help on using the changeset viewer.