Base: fixes #10462: mesh.unite() causes segementaion fault

This commit is contained in:
wmayer
2023-09-03 15:09:35 +02:00
parent f6708547a9
commit 5ab2894828
2 changed files with 34 additions and 4 deletions
+17 -1
View File
@@ -957,7 +957,8 @@ void InventorBuilder::endSeparator()
* A more elaborate description of the constructor.
*/
Builder3D::Builder3D()
: InventorBuilder(result)
: result{}
, builder{result}
{
}
@@ -1010,6 +1011,21 @@ void Builder3D::saveToFile(const char* FileName)
file << result.str();
}
void Builder3D::addNode(const NodeItem& item)
{
builder.addNode(item);
}
void Builder3D::beginSeparator()
{
builder.beginSeparator();
}
void Builder3D::endSeparator()
{
builder.endSeparator();
}
// -----------------------------------------------------------------------------
template<typename T>
+17 -3
View File
@@ -604,7 +604,6 @@ public:
* \brief Closes the last added separator node.
*/
void endSeparator();
/** @name Appearance handling */
private:
void increaseIndent();
@@ -642,11 +641,11 @@ private:
* \endcode
* \see Base::ConsoleSingleton
*/
class BaseExport Builder3D : public InventorBuilder
class BaseExport Builder3D
{
public:
Builder3D();
virtual ~Builder3D();
~Builder3D();
/// clear the string buffer
void clear();
@@ -659,9 +658,24 @@ public:
void saveToFile(const char* FileName);
//@}
/*!
* \brief addNode
* Writes the content of the added node to the output stream.
*/
void addNode(const NodeItem&);
/*!
* \brief Sets a separator node.
*/
void beginSeparator();
/*!
* \brief Closes the last added separator node.
*/
void endSeparator();
private:
/// the result string
std::stringstream result;
InventorBuilder builder;
};
/**