Merge lp:~zorba-coders/zorba/bug1129950 into lp:zorba

Proposed by Juan Zacarias
Status: Merged
Approved by: Juan Zacarias
Approved revision: 11255
Merged at revision: 11255
Proposed branch: lp:~zorba-coders/zorba/bug1129950
Merge into: lp:zorba
Diff against target: 16 lines (+0/-6)
1 file modified
modules/xqxq/xqxq.xq.src/xqxq.cpp (+0/-6)
To merge this branch: bzr merge lp:~zorba-coders/zorba/bug1129950
Reviewer Review Type Date Requested Status
Juan Zacarias Approve
Chris Hillery Approve
Review via email: mp+150105@code.launchpad.net

Commit message

Fix for bug1129950 memory problem when closing xqxq

Description of the change

Fix for bug1129950 memory problem when closing xqxq

To post a comment you must log in.
Revision history for this message
Matthias Brantner (matthias-brantner) wrote :

The expression can be simplified even more to

delete theQueryMap;

Where is the QueryData_t of a query deleted if the user doesn't invoke the DeleteQueryFunction function?

Revision history for this message
Chris Hillery (ceejatec) wrote :

I'm curious about the answer to Matthias' question as well. However, things run valgrind-clean (including no leaks) with and without the explicit call to xqxq:delete-query() in the query, so I'm assuming that it DOES get cleaned up somewhere.

review: Approve
Revision history for this message
Chris Hillery (ceejatec) wrote :

(My guess is that since theQueryMap contains QueryData_t objects - ie, smart pointers - they are reclaimed when theQueryMap is deleted because theQueryMap was the last object maintain a refcount on them.)

Revision history for this message
Juan Zacarias (juan457) :
review: Approve
Revision history for this message
Zorba Build Bot (zorba-buildbot) wrote :
Revision history for this message
Zorba Build Bot (zorba-buildbot) wrote :

Validation queue job bug1129950-2013-02-22T22-55-41.94Z is finished. The final status was:

All tests succeeded!

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1=== modified file 'modules/xqxq/xqxq.xq.src/xqxq.cpp'
2--- modules/xqxq/xqxq.xq.src/xqxq.cpp 2013-02-22 12:37:37 +0000
3+++ modules/xqxq/xqxq.xq.src/xqxq.cpp 2013-02-22 17:14:26 +0000
4@@ -203,12 +203,6 @@
5 {
6 if (theQueryMap)
7 {
8- for (QueryMap_t::const_iterator lIter = theQueryMap->begin();
9- lIter != theQueryMap->end(); ++lIter)
10- {
11- deleteQuery(lIter->first);
12- }
13- theQueryMap->clear();
14 delete theQueryMap;
15 }
16 delete this;

Subscribers

People subscribed via source and target branches