Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

...

While this code ensures that only one Helper object is preserved prevented from being garbage collected, it allows multiple Helper objects to be created. If constructing multiple Helper objects is infeasible or expensive, this solution may be inappropriate unless a weak reference is used to hold Helper.

...