Project

Profile

Help

Revision 55b80284

Added by O'Neil Delpratt 5 months ago

Saxon/C added memory debugging and bug fixes

View differences:

src/main/c/Saxon.C.API/Xslt30Processor.cpp
14 14
#include <typeinfo> //used for testing only
15 15
#endif
16 16

  
17
#ifdef MEM_DEBUG
18
#define new new(__FILE__, __LINE__)
19
#endif
20

  
17 21
Xslt30Processor::Xslt30Processor() {
18 22

  
19 23
	SaxonProcessor *p = new SaxonProcessor(false);
......
58 62
	    clearParameters();
59 63
	    SaxonProcessor::sxn_environ->env->DeleteLocalRef(cppXT);
60 64
	    cwdXT.erase();
65
	    exceptionClear();
61 66
    }
62 67

  
63 68

  
......
111 116
                XdmValue * valuei = it->second;
112 117
                if(valuei != nullptr) {
113 118
                    valuei->decrementRefCount();
114
                    if (valuei->getRefCount() < 1) {
119
                    //if (valuei->getRefCount() < 1) {
115 120
                        delete value;
116
                    }
121
                        value = nullptr;
122
                    //}
117 123
                    parameters.erase(skey);
118 124
                    parameters[skey] = value;
119 125
                    value->incrementRefCount();
......
149 155
                std::cout<<"clearParameter() - XdmValue refCount="<<value->getRefCount()<<std::endl;
150 156
#endif
151 157
                    delete value;
158
                    value = nullptr;
152 159

  
153 160
            }
154 161
        }
......
186 193
}
187 194

  
188 195
void Xslt30Processor::createException(const char * message) {
189

  
190

  
191
    if(exception != nullptr) {
192
        delete exception;
193
        SaxonProcessor::sxn_environ->env->ExceptionClear();
194
    }
195

  
196
    exceptionClear();
196 197
    if(message == nullptr) {
197 198
        exception = proc->checkAndCreateException(cppClass);
198 199
    } else {

Also available in: Unified diff