Merge lp:~matthias-brantner/zorba/bug-fixing into lp:zorba

Proposed by Matthias Brantner
Status: Superseded
Proposed branch: lp:~matthias-brantner/zorba/bug-fixing
Merge into: lp:zorba
Diff against target: 244 lines (+33/-19)
11 files modified
ChangeLog (+1/-0)
include/zorba/static_context.h (+1/-1)
include/zorba/zorba.h (+1/-0)
src/api/staticcontextimpl.cpp (+1/-1)
src/api/staticcontextimpl.h (+1/-1)
src/context/dynamic_loader.cpp (+1/-9)
src/context/dynamic_loader.h (+2/-3)
src/context/static_context.cpp (+3/-3)
src/context/static_context.h (+1/-1)
src/system/globalenv.cpp (+14/-0)
src/system/globalenv.h (+7/-0)
To merge this branch: bzr merge lp:~matthias-brantner/zorba/bug-fixing
Reviewer Review Type Date Requested Status
Matthias Brantner Approve
Markos Zaharioudakis Pending
Review via email: mp+82492@code.launchpad.net

This proposal has been superseded by a proposal from 2011-11-17.

Commit message

- fixed DynamicLoader memory leak
- StaticContext::getAuditEvent const
- added iterator.h include to zorba.h

Description of the change

- fixed DynamicLoader memory leak
- StaticContext::getAuditEvent const
- added iterator.h include to zorba.h

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

Following redirects when resolving URLs. Mostly used when importing modules or schemas. Approved: Chris Hillery, Matthias Brantner

10550. By Daniel Turcanu

Fixed bug #872850 about plan serializer crash Approved: David Graf, Matthias Brantner

10551. By Carlos Manuel Lopez

Optimization of the fn:substring function in the case when its $start and $length arguments are integers. Approved: Matthias Brantner, Markos Zaharioudakis

10552. By Paul J. Lucas

Removed warnings. Approved: Matthias Brantner, Paul J. Lucas

10553. By Markos Zaharioudakis

converted variable assignment to a full-blown expression instead of a function + fixed a bug with the cloning of var_decl_expr Approved: Markos Zaharioudakis

10554. By Matthias Brantner

- fixed DynamicLoader memory leak
- StaticContext::getAuditEvent const
- added iterator.h include to zorba.h
- fn:trace should not be constant folded and propagate the return type of its first argument Approved: Markos Zaharioudakis, Matthias Brantner

10555. By Matthias Brantner

- Reorganization of ChangeLog for 2.1 release
- added the xqxq-module to the modules that are downloaded automatically Approved: Chris Hillery, Matthias Brantner

10556. By Matthias Brantner

Allow external functions to be updating. Approved: Markos Zaharioudakis, Juan Zacarias

10557. By Markos Zaharioudakis

fixed a performance bug in the implementation of groupby: no node copying for non-groupby vars Approved: Matthias Brantner, Markos Zaharioudakis

10558. By Sorin Marian Nasoi

Fix for bug #897619. Approved: Markos Zaharioudakis, Sorin Marian Nasoi

10559. By Sorin Marian Nasoi

Fix for bug #897616. Approved: Nicolae Brinza, Sorin Marian Nasoi

10560. By Matthias Brantner

Do not raise warnings for unknown annotations in unknown namespaces Approved: Nicolae Brinza, William Candillon, Matthias Brantner

10561. By Juan Zacarias

API changes
Removed isBoundExternalVariable from xquery.h
Added 2 functions to dynamic_context.h
isBoundContextItem and isBoundExternalVariable Approved: Matthias Brantner, Markos Zaharioudakis

10562. By Daniel Turcanu

fn:analyze-string fix
also, adding config.h include to ensure correct error messages Approved: Chris Hillery, Matthias Brantner

10563. By Matthias Brantner

fix for building modules outside of Zorba Approved: Chris Hillery, Matthias Brantner

10564. By William Candillon

Fix bug #897825 Approved: Rodolfo Ochoa, Matthias Brantner

10565. By Matthias Brantner

Unmarked XQueryX fn-put-005-fail as expected to fail in CMake. Approved: Chris Hillery, Matthias Brantner

10566. By Chris Hillery

Update ExternalModules.conf to download modules tagged 'zorba-2.1'. Approved: Matthias Brantner, Chris Hillery

10567. By Chris Hillery

fix for installing and using modules on windows Approved: Chris Hillery, Matthias Brantner

10568. By Chris Hillery

Separate check_uris into check_core_uris and check_uris. zorbacmd depends on check_core_uris, so non-core modules may depend on zorbacmd and be assured that the Zorba executable is fully functional. Approved: Matthias Brantner, Chris Hillery

10569. By Chris Hillery

Fix reversed URI installation directories. Approved: Matthias Brantner, Chris Hillery

10570. By Matthias Brantner

fix for bug #898064 Approved: Nicolae Brinza, William Candillon

10571. By Markos Zaharioudakis

small optimization of the group by Approved: Markos Zaharioudakis

10572. By Matthias Brantner

made destructors of Item subclasses virtual Approved: Markos Zaharioudakis, Matthias Brantner

10573. By Matthias Brantner

optimization: only have exactly two instances of boolean items in the simple store Approved: Markos Zaharioudakis, Matthias Brantner

10574. By Chris Hillery

Only create check_core_uris and associated dependencies if there are any core URIs (to prevent creating this target in standalone module projects).
 Approved: Juan Zacarias, Chris Hillery

10575. By Paul J. Lucas

undo previous changes and mark bug as expected to fail. Approved: Paul J. Lucas, Matthias Brantner

10576. By Paul J. Lucas

Things should be reverted now. Approved: Matthias Brantner, Paul J. Lucas

10577. By Matthias Brantner

fix build on windows Approved: Juan Zacarias, Matthias Brantner

10578. By Paul J. Lucas

Fixed build. Approved: Matthias Brantner, Paul J. Lucas

10579. By Matthias Brantner

exclude .bzr dir from source packages Approved: Cezar Andrei, Matthias Brantner

10580. By Markos Zaharioudakis

Cleaned up unused stuff in debugger_expr Approved: Gabriel Petrovay, Markos Zaharioudakis

10581. By Matthias Brantner

removed obsolete code guarded by the USE_POS macro Approved: Markos Zaharioudakis, Matthias Brantner

10582. By Matthias Brantner

- automatic caching of recursive, non-sequential, and deterministic functions with atomic parameter and return types
- %ann:cache and %ann:no-cache for controlling function result caching Approved: Markos Zaharioudakis, Matthias Brantner

10583. By Markos Zaharioudakis

Optimized and cleaned up SimpleTempSeq implementation and its usage. Approved: Markos Zaharioudakis

10584. By Paul J. Lucas

Applied William's patch; patched William's patch to handle UTF-8 properly. Approved: William Candillon, Paul J. Lucas

Unmerged revisions

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1=== modified file 'ChangeLog'
2--- ChangeLog 2011-11-16 04:00:29 +0000
3+++ ChangeLog 2011-11-17 05:05:28 +0000
4@@ -29,6 +29,7 @@
5 corruption will occur)
6 * Fixed bug # (Should not destroy the parent of a node that is being detached
7 before the detach is done).
8+ * Added const qualifier to StaticContext::getAuditEvent()
9 * Fixed bug #3408181 (available-collection() returns undeclared collections)
10 * Fixed bug #859465 (Fatal error if a PUL contains two deactivate IC primitives)
11 * Fixed bug #859467 (Fatal error if a PUL contains two activate Foreign Key primitives)
12
13=== modified file 'include/zorba/static_context.h'
14--- include/zorba/static_context.h 2011-11-15 08:23:20 +0000
15+++ include/zorba/static_context.h 2011-11-17 05:05:28 +0000
16@@ -586,7 +586,7 @@
17 * @return the audit event
18 */
19 virtual audit::Event*
20- getAuditEvent() = 0;
21+ getAuditEvent() const = 0;
22
23
24 /** \brief Returns the QName of all external variables within the
25
26=== modified file 'include/zorba/zorba.h'
27--- include/zorba/zorba.h 2011-06-17 03:47:29 +0000
28+++ include/zorba/zorba.h 2011-11-17 05:05:28 +0000
29@@ -33,6 +33,7 @@
30 #include <zorba/collection_manager.h>
31 #include <zorba/xquery.h>
32 #include <zorba/zorba_string.h>
33+#include <zorba/iterator.h>
34
35 namespace zorba {
36
37
38=== modified file 'src/api/staticcontextimpl.cpp'
39--- src/api/staticcontextimpl.cpp 2011-11-15 08:23:20 +0000
40+++ src/api/staticcontextimpl.cpp 2011-11-17 05:05:28 +0000
41@@ -1424,7 +1424,7 @@
42
43
44 audit::Event*
45-StaticContextImpl::getAuditEvent()
46+StaticContextImpl::getAuditEvent() const
47 {
48 return theCtx->get_audit_event();
49 }
50
51=== modified file 'src/api/staticcontextimpl.h'
52--- src/api/staticcontextimpl.h 2011-11-15 08:23:20 +0000
53+++ src/api/staticcontextimpl.h 2011-11-17 05:05:28 +0000
54@@ -246,7 +246,7 @@
55 setAuditEvent(audit::Event* anEvent);
56
57 virtual audit::Event*
58- getAuditEvent();
59+ getAuditEvent() const;
60
61 virtual void
62 getExternalVariables(Iterator_t& aVarsIter) const;
63
64=== modified file 'src/context/dynamic_loader.cpp'
65--- src/context/dynamic_loader.cpp 2011-10-19 16:19:45 +0000
66+++ src/context/dynamic_loader.cpp 2011-11-17 05:05:28 +0000
67@@ -191,14 +191,6 @@
68 }
69
70
71-DynamicLoader&
72-DynamicLoader::getInstance()
73-{
74- static DynamicLoader singleton;
75- return singleton;
76-}
77-
78-
79 DynamicLoader::~DynamicLoader()
80 {
81 for (LibrarySet_t::const_iterator lIter = theLibraries.begin();
82@@ -265,7 +257,7 @@
83
84 if (modfile->good())
85 {
86- ExternalModule* lModule = getInstance().loadModule(potentialModuleFile);
87+ ExternalModule* lModule = loadModule(potentialModuleFile);
88 if (lModule)
89 {
90 if (lModule->getURI().c_str() != aNsURI)
91
92=== modified file 'src/context/dynamic_loader.h'
93--- src/context/dynamic_loader.h 2011-08-08 13:51:27 +0000
94+++ src/context/dynamic_loader.h 2011-11-17 05:05:28 +0000
95@@ -29,18 +29,17 @@
96 class DynamicLoader
97 {
98 public:
99- static ExternalModule* getExternalModule(
100+ ExternalModule* getExternalModule(
101 zstring const& aNsURI,
102 static_context& aSctx);
103
104 private:
105
106+ friend class GlobalEnvironment;
107 DynamicLoader();
108
109 ~DynamicLoader();
110
111- static DynamicLoader& getInstance();
112-
113 ExternalModule* loadModule(const zstring& aFile) const;
114
115 #ifdef WIN32
116
117=== modified file 'src/context/static_context.cpp'
118--- src/context/static_context.cpp 2011-11-15 08:23:20 +0000
119+++ src/context/static_context.cpp 2011-11-17 05:05:28 +0000
120@@ -207,7 +207,7 @@
121 if (dyn_loaded_module)
122 {
123 ZORBA_ASSERT(sctx);
124- module = DynamicLoader::getExternalModule(lURI, *sctx);
125+ module = GENV_DYNAMIC_LOADER->getExternalModule(lURI, *sctx);
126
127 // no way to get the module
128 if (!module)
129@@ -2634,7 +2634,7 @@
130 // dynamic loader
131 if (!found)
132 {
133- lModule = DynamicLoader::getExternalModule(aURI, *this);
134+ lModule = GENV_DYNAMIC_LOADER->getExternalModule(aURI, *this);
135
136 // no way to get the module
137 if (!lModule)
138@@ -3400,7 +3400,7 @@
139 /***************************************************************************//**
140
141 ********************************************************************************/
142-audit::Event* static_context::get_audit_event()
143+audit::Event* static_context::get_audit_event() const
144 {
145 const static_context* sctx = this;
146 audit::Event* res = sctx->theAuditEvent;
147
148=== modified file 'src/context/static_context.h'
149--- src/context/static_context.h 2011-11-15 08:23:20 +0000
150+++ src/context/static_context.h 2011-11-17 05:05:28 +0000
151@@ -917,7 +917,7 @@
152 //
153 void set_audit_event(audit::Event* ae);
154
155- audit::Event* get_audit_event();
156+ audit::Event* get_audit_event() const;
157
158
159 //
160
161=== modified file 'src/system/globalenv.cpp'
162--- src/system/globalenv.cpp 2011-11-02 06:14:25 +0000
163+++ src/system/globalenv.cpp 2011-11-17 05:05:28 +0000
164@@ -34,6 +34,7 @@
165 #include "types/schema/schema.h"
166 #include "context/root_static_context.h"
167 #include "context/default_url_resolvers.h"
168+#include "context/dynamic_loader.h"
169 #include "functions/library.h"
170 #include "annotations/annotations.h"
171 #include "compiler/api/compiler_api.h"
172@@ -98,6 +99,8 @@
173 m_globalEnv->m_compilerSubSys = lSubSystem.release();
174
175 m_globalEnv->m_http_resolver = new internal::HTTPURLResolver();
176+
177+ m_globalEnv->m_dynamic_loader = 0;
178 }
179
180
181@@ -105,6 +108,8 @@
182 // note: destruction must be done in reverse initialization order
183 void GlobalEnvironment::destroy()
184 {
185+ delete m_globalEnv->m_dynamic_loader;
186+
187 delete m_globalEnv->m_http_resolver;
188
189 serialization::ClassSerializer::getInstance()->destroyArchiverForHardcodedObjects();
190@@ -273,6 +278,15 @@
191 return *m_compilerSubSys;
192 }
193
194+DynamicLoader* GlobalEnvironment::getDynamicLoader() const
195+{
196+ if (!m_dynamic_loader)
197+ {
198+ m_dynamic_loader = new DynamicLoader();
199+ }
200+ return m_dynamic_loader;
201+}
202+
203 #ifdef ZORBA_XQUERYX
204 XQueryXConvertor *GlobalEnvironment::getXQueryXConvertor()
205 {
206
207=== modified file 'src/system/globalenv.h'
208--- src/system/globalenv.h 2011-10-21 03:05:49 +0000
209+++ src/system/globalenv.h 2011-11-17 05:05:28 +0000
210@@ -27,6 +27,7 @@
211 class RootTypeManager;
212 class root_static_context;
213 class XQueryXConvertor;
214+class DynamicLoader;
215
216 namespace internal {
217 class HTTPURLResolver;
218@@ -67,6 +68,8 @@
219 internal::ThesaurusURLResolver * m_thesaurus_resolver;
220 #endif /* ZORBA_NO_FULL_TEXT */
221
222+ mutable DynamicLoader * m_dynamic_loader;
223+
224 public:
225
226 static void init(store::Store* store);
227@@ -108,6 +111,8 @@
228 internal::ThesaurusURLResolver* getThesaurusURLResolver() const { return m_thesaurus_resolver; }
229 #endif /* ZORBA_NO_FULL_TEXT */
230
231+ DynamicLoader* getDynamicLoader() const;
232+
233 #ifdef ZORBA_XQUERYX
234 XQueryXConvertor* getXQueryXConvertor();
235 #endif
236@@ -135,6 +140,8 @@
237
238 #define GENV_ROOT_STATIC_CONTEXT GlobalEnvironment::getInstance().getRootStaticContext()
239
240+#define GENV_DYNAMIC_LOADER GlobalEnvironment::getInstance().getDynamicLoader()
241+
242 }
243
244 #endif /* ZORBA_GLOBALENV_H */

Subscribers

People subscribed via source and target branches