mirror of
https://github.com/IfcOpenShell/IfcOpenShell.git
synced 2026-08-09 09:21:46 +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) {
|
||||
file = f;
|
||||
#ifdef HAVE_ICU
|
||||
if (destination != nullptr) {
|
||||
ucnv_close(destination);
|
||||
}
|
||||
if (destination) ucnv_close(destination);
|
||||
if (compatibility_converter) ucnv_close(compatibility_converter);
|
||||
destination = nullptr;
|
||||
compatibility_converter = nullptr;
|
||||
|
||||
if (mode == DEFAULT) {
|
||||
destination = ucnv_open(nullptr, &status);
|
||||
@@ -112,8 +112,10 @@ IfcCharacterDecoder::~IfcCharacterDecoder() {
|
||||
#ifdef HAVE_ICU
|
||||
if ( destination ) ucnv_close(destination);
|
||||
if ( converter ) ucnv_close(converter);
|
||||
if ( compatibility_converter ) ucnv_close(compatibility_converter);
|
||||
destination = nullptr;
|
||||
converter = nullptr;
|
||||
compatibility_converter = nullptr;
|
||||
#endif
|
||||
}
|
||||
IfcCharacterDecoder::operator std::string() {
|
||||
|
||||
Reference in New Issue
Block a user