Commit 43de25a5 authored by Brian Panneton's avatar Brian Panneton
Browse files

FIX: Corrected a segfault when two objects are next to each other.

Also added extra install commands.
parent 02e1a0ee
......@@ -120,7 +120,10 @@ if(XDMF_WRAP_JAVA)
${CMAKE_BINARY_DIR}/${java_name}.jar
${XDMF_JAVA_DIR}
)
install(FILES ${CMAKE_BINARY_DIR}/${java_name}.jar DESTINATION lib/java)
install(FILES ${CMAKE_BINARY_DIR}/${java_name}.jar
DESTINATION lib/java)
install(TARGETS ${SWIG_MODULE_${java_name}Java_REAL_NAME}
DESTINATION lib/java)
ENDMACRO(XDMF_SWIG_JAVA)
endif(XDMF_WRAP_JAVA)
......@@ -173,7 +176,7 @@ if(NOT XDMF_BUILD_CORE_ONLY)
add_subdirectory(utils)
endif(XDMF_BUILD_UTILS)
file(GLOB XdmfHeaders *.hpp)
file(GLOB XdmfHeaders "*.hpp" "*.tpp" "*.i")
install(FILES ${XdmfHeaders} DESTINATION include)
install(TARGETS Xdmf LIBRARY DESTINATION lib)
endif(NOT XDMF_BUILD_CORE_ONLY)
......@@ -82,7 +82,7 @@ if(XDMF_WRAP_PYTHON)
XDMF_SWIG_PYTHON(XdmfCore)
endif(XDMF_WRAP_PYTHON)
file(GLOB XdmfCoreHeaders *.hpp)
file(GLOB_RECURSE XdmfCoreHeaders "*.hpp" "*.tpp" "*.i")
file(GLOB LokiHeaders loki/*.h)
install(FILES ${XdmfCoreHeaders} DESTINATION include)
install(FILES ${LokiHeaders} DESTINATION include/loki)
......
......@@ -103,6 +103,8 @@ public:
return myItems;
}
int globalCount;
/**
* Reads a single xmlNode into an XdmfItem object in memory. The constructed XdmfItem is added to myItems and an entry is added mapping the xmlNodePtr to the new XdmfItem in the mXPathMap.
*/
......@@ -117,23 +119,26 @@ public:
{
std::map<std::string, std::string> itemProperties;
if(currNode->children != NULL)
{
itemProperties["Content"] = (const char *)currNode->children->content;
{
if(currNode->children->content != NULL)
itemProperties["Content"] = (const char *)currNode->children->content;
else itemProperties["Content"] = "";
itemProperties["XMLDir"] = mXMLDir;
}
xmlAttrPtr currAttribute = currNode->properties;
while(currAttribute != NULL)
{
itemProperties[(const char *)currAttribute->name] = (const char *)currAttribute->children->content;
currAttribute = currAttribute->next;
}
std::vector<boost::shared_ptr<XdmfItem> > childItems = this->read(currNode->children);
boost::shared_ptr<XdmfItem> newItem = mItemFactory->createItem((const char *)currNode->name, itemProperties, childItems);
if(newItem == NULL)
{
assert(false);
}
newItem->populateItem(itemProperties, childItems, mCoreReader);
myItems.push_back(newItem);
mXPathMap[currNode] = newItem;
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment