Thread
:
Qt: ridiculous behaviour
View Single Post
hqh
2010-04-07 , 21:51
Posts: 388 | Thanked: 842 times | Joined on Sep 2009 @ Finland
#
3
It's not exactly the same. In first case the manager object gets automatically deleted when it goes out of scope (that is, when '}' is reached if I remember correctly).
In the second case the manager object (to which the pointer refers to) allocated with "new" never gets deleted unless "delete" is used on it. It results in memory leak if you forget to delete it.
Quote & Reply
|
The Following 2 Users Say Thank You to hqh For This Useful Post:
nath
,
Venemo
hqh
View Public Profile
Send a private message to hqh
Find all posts by hqh