mirror of
https://github.com/IfcOpenShell/IfcOpenShell.git
synced 2026-09-18 22:33:33 +00:00
avoid leaks (compatibility_converter)
This commit is contained in:
@@ -90,10 +90,10 @@ void IfcCharacterDecoder::addChar(std::stringstream& s,const UChar32& ch) {
|
|||||||
IfcCharacterDecoder::IfcCharacterDecoder(IfcParse::File* f) {
|
IfcCharacterDecoder::IfcCharacterDecoder(IfcParse::File* f) {
|
||||||
file = f;
|
file = f;
|
||||||
#ifdef HAVE_ICU
|
#ifdef HAVE_ICU
|
||||||
if (destination != nullptr) {
|
if (destination) ucnv_close(destination);
|
||||||
ucnv_close(destination);
|
if (compatibility_converter) ucnv_close(compatibility_converter);
|
||||||
}
|
|
||||||
destination = nullptr;
|
destination = nullptr;
|
||||||
|
compatibility_converter = nullptr;
|
||||||
|
|
||||||
if (mode == DEFAULT) {
|
if (mode == DEFAULT) {
|
||||||
destination = ucnv_open(nullptr, &status);
|
destination = ucnv_open(nullptr, &status);
|
||||||
@@ -112,8 +112,10 @@ IfcCharacterDecoder::~IfcCharacterDecoder() {
|
|||||||
#ifdef HAVE_ICU
|
#ifdef HAVE_ICU
|
||||||
if ( destination ) ucnv_close(destination);
|
if ( destination ) ucnv_close(destination);
|
||||||
if ( converter ) ucnv_close(converter);
|
if ( converter ) ucnv_close(converter);
|
||||||
|
if ( compatibility_converter ) ucnv_close(compatibility_converter);
|
||||||
destination = nullptr;
|
destination = nullptr;
|
||||||
converter = nullptr;
|
converter = nullptr;
|
||||||
|
compatibility_converter = nullptr;
|
||||||
#endif
|
#endif
|
||||||
}
|
}
|
||||||
IfcCharacterDecoder::operator std::string() {
|
IfcCharacterDecoder::operator std::string() {
|
||||||
|
|||||||
Reference in New Issue
Block a user