Introducing QScopedPointer

Qt usually takes the boring memory allocation and deallocation from you, either through its implicitly shared containers, or with QObject’s parent child relationship model. But every once in a while, we need to allocate something on the heap, and then the stress starts – where do we delete it, and how do we make sure to not leak the memory? To fix this problem, QScopedPointer was born. It will delete the object it is pointing to automatically when it goes out of scope.

12 Comments

  1. 2009-08-24 6:41 pm
    • 2009-08-24 6:47 pm
    • 2009-08-25 7:10 am
      • 2009-08-25 8:03 am
      • 2009-08-27 4:56 pm
  2. 2009-08-24 9:45 pm
    • 2009-08-24 10:08 pm
    • 2009-08-25 1:38 pm
    • 2009-08-26 2:07 pm
  3. 2009-08-25 11:31 am
  4. 2009-08-25 2:19 pm
  5. 2009-08-25 10:26 pm