zorba-coders team mailing list archive
-
zorba-coders team
-
Mailing list archive
-
Message #16790
[Merge] lp:~zorba-coders/zorba/markos-scratch into lp:zorba
Markos Zaharioudakis has proposed merging lp:~zorba-coders/zorba/markos-scratch into lp:zorba.
Commit message:
fixed bug #1097101
Requested reviews:
Markos Zaharioudakis (markos-za)
For more details, see:
https://code.launchpad.net/~zorba-coders/zorba/markos-scratch/+merge/142307
fixed bug #1097101
--
https://code.launchpad.net/~zorba-coders/zorba/markos-scratch/+merge/142307
Your team Zorba Coders is subscribed to branch lp:zorba.
=== modified file 'src/types/root_typemanager.cpp'
--- src/types/root_typemanager.cpp 2012-12-18 15:57:51 +0000
+++ src/types/root_typemanager.cpp 2013-01-08 13:00:33 +0000
@@ -384,17 +384,20 @@
XS_NMTOKENS_TYPE = new UserDefinedXQType(this,
XS_NMTOKENS_QNAME,
NULL,
- NMTOKEN_TYPE_ONE.getp());
+ NMTOKEN_TYPE_ONE.getp(),
+ true);
XS_ENTITIES_TYPE = new UserDefinedXQType(this,
XS_ENTITIES_QNAME,
NULL,
- ENTITY_TYPE_ONE.getp());
+ ENTITY_TYPE_ONE.getp(),
+ true);
XS_IDREFS_TYPE = new UserDefinedXQType(this,
XS_IDREFS_QNAME,
NULL,
- IDREF_TYPE_ONE.getp());
+ IDREF_TYPE_ONE.getp(),
+ true);
STRUCTURED_ITEM_TYPE_ONE =
new StructuredItemXQType(this, TypeConstants::QUANT_ONE, true);
@@ -577,6 +580,14 @@
DELETE_TYPE(ANY_NODE)
DELETE_TYPE(STRUCTURED_ITEM)
+ // These must be deallocated first because they may reference other types
+ delete XS_NMTOKENS_TYPE.getp();
+ XS_NMTOKENS_TYPE.setNull();
+ delete XS_ENTITIES_TYPE.getp();
+ XS_ENTITIES_TYPE.setNull();
+ delete XS_IDREFS_TYPE.getp();
+ XS_IDREFS_TYPE.setNull();
+
#ifdef ZORBA_WITH_JSON
DELETE_TYPE(JS_NULL)
=== modified file 'src/types/typeimpl.cpp'
--- src/types/typeimpl.cpp 2013-01-08 11:07:41 +0000
+++ src/types/typeimpl.cpp 2013-01-08 13:00:33 +0000
@@ -1113,9 +1113,10 @@
const xqtref_t& baseType,
TypeConstants::quantifier_t quantifier,
type_category_t typeCategory,
- content_kind_t contentKind)
+ content_kind_t contentKind,
+ bool builtin)
:
- XQType(manager, USER_DEFINED_KIND, quantifier, false),
+ XQType(manager, USER_DEFINED_KIND, quantifier, builtin),
m_qname(qname),
m_baseType(baseType),
m_typeCategory(typeCategory),
@@ -1139,9 +1140,10 @@
const TypeManager* manager,
store::Item_t qname,
const xqtref_t& baseType,
- const XQType* listItemType)
+ const XQType* listItemType,
+ bool builtin)
:
- XQType(manager, USER_DEFINED_KIND, TypeConstants::QUANT_STAR, false),
+ XQType(manager, USER_DEFINED_KIND, TypeConstants::QUANT_STAR, builtin),
m_qname(qname),
m_baseType(baseType),
m_typeCategory(LIST_TYPE),
@@ -1160,9 +1162,10 @@
store::Item_t qname,
const xqtref_t& baseType,
TypeConstants::quantifier_t quantifier,
- const std::vector<xqtref_t>& unionItemTypes)
+ const std::vector<xqtref_t>& unionItemTypes,
+ bool builtin)
:
- XQType(manager, USER_DEFINED_KIND, quantifier, false),
+ XQType(manager, USER_DEFINED_KIND, quantifier, builtin),
m_qname(qname),
m_baseType(baseType),
m_typeCategory(UNION_TYPE),
=== modified file 'src/types/typeimpl.h'
--- src/types/typeimpl.h 2012-12-28 10:24:59 +0000
+++ src/types/typeimpl.h 2013-01-08 13:00:33 +0000
@@ -739,14 +739,16 @@
const xqtref_t& baseType,
TypeConstants::quantifier_t quantifier,
type_category_t typeCategory,
- content_kind_t contentKind);
+ content_kind_t contentKind,
+ bool builtin = false);
// Constructor for List types
UserDefinedXQType(
const TypeManager* manager,
store::Item_t qname,
const xqtref_t& baseType,
- const XQType* listItemType);
+ const XQType* listItemType,
+ bool builtin = false);
// Constructor for Union types
UserDefinedXQType(
@@ -754,7 +756,8 @@
store::Item_t qname,
const xqtref_t& baseType,
TypeConstants::quantifier_t quantifier,
- const std::vector<xqtref_t>& unionItemTypes);
+ const std::vector<xqtref_t>& unionItemTypes,
+ bool builtin = false);
virtual ~UserDefinedXQType() {}
Follow ups