Merge lp://staging/~michihenning/online-accounts-api/leak-fix into lp://staging/online-accounts-api
Proposed by
Michi Henning
Status: | Merged | ||||
---|---|---|---|---|---|
Approved by: | Alberto Mardegan | ||||
Approved revision: | 44 | ||||
Merged at revision: | 42 | ||||
Proposed branch: | lp://staging/~michihenning/online-accounts-api/leak-fix | ||||
Merge into: | lp://staging/online-accounts-api | ||||
Diff against target: |
42 lines (+4/-2) 3 files modified
src/lib/OnlineAccounts/pending_call.h (+2/-1) src/lib/OnlineAccountsDaemon/i18n.cpp (+1/-1) src/lib/Ubuntu/OnlineAccounts.2/account.cpp (+1/-0) |
||||
To merge this branch: | bzr merge lp://staging/~michihenning/online-accounts-api/leak-fix | ||||
Related bugs: |
|
Reviewer | Review Type | Date Requested | Status |
---|---|---|---|
Alberto Mardegan (community) | Approve | ||
Review via email: mp+313667@code.staging.launchpad.net |
Commit message
Fixed memory leak in PendingCallWatcher.
Got rid of compiler warning.
Added missing \endlist to documentation.
Description of the change
Fixed memory leak in PendingCallWatcher.
Got rid of compiler warning.
Added missing \endlist to documentation.
This would not have happened with std::unique_ptr or QScopedPointer. I strongly recommend to never use raw pointers. As this particular example demonstrates, it is easy to get even the most simple case wrong. It took me considerable time to track this down; much better to not allow this type of error to ever arise in the first place.
To post a comment you must log in.
Hi Michi! I still do prefer an explicit delete, when the lifetime of the object is as simple as in this case (and yet I forgot it! :-) ).
If you still decide to go for the QScopedPointer, please add its include file to pending_call.h (now it works even without it, but compilation might break on a future Qt release).