Project

Profile

Help

Revision 9e416749

Added by O'Neil Delpratt 6 months ago

Saxon/C seg error fix

View differences:

src/main/c/Saxon.C.API/XsltExecutable.cpp
44 44
XsltExecutable::~XsltExecutable() {
45 45
    clearProperties();
46 46
    clearParameters();
47
    if (selectionV != nullptr) {
48
        selectionV->decrementRefCount();
49
        if (selectionV->getRefCount() == 0) {
50
            delete selectionV;
51
        }
52
    } else {
53
        if (selection) {
54
            SaxonProcessor::sxn_environ->env->DeleteGlobalRef(selection);
55
        }
47

  
48
    if(selection) {
49
        SaxonProcessor::sxn_environ->env->DeleteGlobalRef(selection);
50
        selection = nullptr;
56 51
    }
52

  
57 53
    SaxonProcessor::sxn_environ->env->DeleteGlobalRef(executableObject);
58 54

  
59 55
}
......
256 252
            }
257 253
        }
258 254

  
259
        if(selection) {
260
            SaxonProcessor::sxn_environ->env->DeleteGlobalRef(selection);
261
            selection = nullptr;
262
        }
255

  
263 256
    } else {
264 257
        for (std::map<std::string, XdmValue *>::iterator itr = parameters.begin(); itr != parameters.end(); itr++) {
265 258

  
......
269 262
            }
270 263

  
271 264
        }
272
        if(selection) {
273
            SaxonProcessor::sxn_environ->env->DeleteGlobalRef(selection);
274
            selection = nullptr;
275
        }
265

  
276 266
    }
277 267
    parameters.clear();
278 268

  

Also available in: Unified diff