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/Xslt30Processor.cpp
139 139

  
140 140

  
141 141
void Xslt30Processor::clearParameters(bool delValues) {
142
    std::cout<<"clearParameter" <<std::endl;
143 142
	if(delValues){
144 143
        for(std::map<std::string, XdmValue*>::iterator itr = parameters.begin(); itr != parameters.end(); itr++){
145 144
            XdmValue * value = itr->second;
146
            std::cout<<"clearParameter cp0" <<"ob ref="<<(value)<<std::endl;
147 145
            if(value != nullptr) {
148
                std::cout<<"clearParameter cp0-1" <<std::endl;
149 146
                value->decrementRefCount();
150 147
#ifdef DEBUG
151 148
                std::cout<<"clearParameter() - XdmValue refCount="<<value->getRefCount()<<std::endl;
......
154 151
                    delete value;
155 152
                }
156 153
            }
157
            std::cout<<"clearParameter cp0-2" <<std::endl;
158 154
        }
159 155

  
160 156
	} else {
161
        std::cout<<"clearParameter cp1-0" <<std::endl;
162
        for(std::map<std::string, XdmValue*>::iterator itr = parameters.begin(); itr != parameters.end(); itr++){
163

  
164
			XdmValue * value = itr->second;
165
            std::cout<<"clearParameter cp1" <<"ob ref="<<(value)<<std::endl;
157
        	for(std::map<std::string, XdmValue*>::iterator itr = parameters.begin(); itr != parameters.end(); itr++){
166 158

  
167
            if(value == NULL) {
168
                std::cout<<"clearParameter cp1-0 after itr NULL found!!!!!" <<std::endl;
169
            }
170
			if(value != nullptr) {
171
                std::cout<<"clearParameter cp1-1" <<std::endl;
172
                value->decrementRefCount();
173
            }
159
			parameters.erase(itr);
174 160
		
175 161
        	}
176 162

  
177 163
	}
178
    std::cout<<"clearParameter cp1" <<std::endl;
179 164
	parameters.clear();
180
    std::cout<<"clearParameter cp2" <<std::endl;
181

  
182 165
	
183 166
}
184 167

  

Also available in: Unified diff