Project

Profile

Help

Revision 85a9912e

Added by Dave Delpratt 5 months ago

Saxon/C Seg Error fixes

View differences:

src/main/c/Saxon.C.API/XdmValue.cpp
127 127

  
128 128
XdmValue::~XdmValue() {
129 129
	//bool safeToClear = false;
130
	std::cout<<"xdmValue destructor size= "<<values.size()<<" ref="<<getRefCount()<<std::endl;
130
	//std::cout<<"xdmValue destructor size= "<<values.size()<<" ref="<<getRefCount()<<" Pointer = "<<(this)<<std::endl;
131 131
    //if(getRefCount()<1){
132
    std::cout<<"xdmValue destructor refCount="<<getRefCount()<<" values.size="<<values.size()<<std::endl;
133 132
	//proc->env->ReleaseObject
134 133
	if(values.size() > 0) {
135 134
        for (size_t i = 0; i < values.size(); i++) {
136 135
            values[i]->decrementRefCount();
137
            std::cout << "xdmItem (XdmValue destructor) refCount=" << values[i]->getRefCount() << std::endl;
138 136
            if (values[i] != nullptr && values[i]->getRefCount() < 1) {
139 137
                delete values[i];
140 138
            }
......
143 141
    }
144 142
	if (valueType != nullptr) { delete valueType; }
145 143
	if (jValues) {
146
        std::cout<<"xdmValue (jValues) jni"<<getRefCount()<<std::endl;
147 144
		SaxonProcessor::sxn_environ->env->DeleteLocalRef(jValues);
148 145
	}
149 146
	xdmSize = 0;
......
153 150
    if(!toStringValue.empty()) {
154 151
        toStringValue.clear();
155 152
    }
156
    std::cout<<"end - xdmValue destructor refCount="<<getRefCount()<<std::endl;
157 153

  
158 154
}
159 155

  

Also available in: Unified diff