From f28aa26ab2827b3c2675517049687226c9c02c0a Mon Sep 17 00:00:00 2001 From: Martin Date: Mon, 14 Sep 2015 13:26:19 +0200 Subject: [PATCH] closes #1 refs !1 *changed the static variables to be common variables. If one opens a lot of files, using thread local could be an alternative as long as the compiler supports it. --- src/OpenMesh/Core/IO/reader/OBJReader.cc | 4 ++-- src/OpenMesh/Core/IO/reader/OFFReader.cc | 4 ++-- src/OpenMesh/Core/IO/reader/STLReader.cc | 4 ++-- 3 files changed, 6 insertions(+), 6 deletions(-) diff --git a/src/OpenMesh/Core/IO/reader/OBJReader.cc b/src/OpenMesh/Core/IO/reader/OBJReader.cc index 7c8803fc..edb66a80 100644 --- a/src/OpenMesh/Core/IO/reader/OBJReader.cc +++ b/src/OpenMesh/Core/IO/reader/OBJReader.cc @@ -172,7 +172,7 @@ read_material(std::fstream& _in) std::string keyWrd; std::string textureName; - static std::stringstream stream; + std::stringstream stream; std::string key; Material mat; @@ -308,7 +308,7 @@ read(std::istream& _in, BaseImporter& _bi, Options& _opt) std::string matname; - static std::stringstream stream, lineData, tmp; + std::stringstream stream, lineData, tmp; // Options supplied by the user diff --git a/src/OpenMesh/Core/IO/reader/OFFReader.cc b/src/OpenMesh/Core/IO/reader/OFFReader.cc index 94e2ccf1..062bbc23 100644 --- a/src/OpenMesh/Core/IO/reader/OFFReader.cc +++ b/src/OpenMesh/Core/IO/reader/OFFReader.cc @@ -192,8 +192,8 @@ _OFFReader_::read_ascii(std::istream& _in, BaseImporter& _bi, Options& _opt) con OpenMesh::Vec4f c4f; BaseImporter::VHandles vhandles; VertexHandle vh; - static std::stringstream stream; - static std::string trash; + std::stringstream stream; + std::string trash; // read header line std::string header; diff --git a/src/OpenMesh/Core/IO/reader/STLReader.cc b/src/OpenMesh/Core/IO/reader/STLReader.cc index c75c81f2..90631c70 100644 --- a/src/OpenMesh/Core/IO/reader/STLReader.cc +++ b/src/OpenMesh/Core/IO/reader/STLReader.cc @@ -249,8 +249,8 @@ read_stla(std::istream& _in, BaseImporter& _bi, Options& _opt) const std::string line; - static std::string garbage; - static std::stringstream strstream; + std::string garbage; + std::stringstream strstream; bool facet_normal(false);