Skip to content

Commit

Permalink
pass the unpackaged by reference
Browse files Browse the repository at this point in the history
  • Loading branch information
gonuke committed Apr 16, 2024
1 parent f530690 commit 9b44b17
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
2 changes: 1 addition & 1 deletion src/package.cc
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ Package::Ptr Package::Create(std::string name, double fill_min, double fill_max,
// singleton pattern:
// if the static member is not yet set, create a new object
// otherwise return the object that already exists
Package::Ptr unpackaged() {
Package::Ptr& unpackaged() {

if !unpackaged_ {
unpackaged_ = new Package(unpackaged_name_);
Expand Down
2 changes: 1 addition & 1 deletion src/package.h
Original file line number Diff line number Diff line change
Expand Up @@ -65,7 +65,7 @@ class Package {

static const int unpackaged_id_ = 1;
static const char* unpackaged_name_ = "unpackaged";
static Ptr unpackaged_ = NULL;
static Ptr& unpackaged_ = NULL;
static int next_package_id_;

std::string name_;
Expand Down

0 comments on commit 9b44b17

Please sign in to comment.