I use regex.pcreReplaceCallback. Sometimes I have more than one back to back in the same script where each uses a different callback routine. These are not the handle form, they use regex.pcreReplaceCallback. Each pattern usually has a different number of captures, so the size of the st_offset_vec varies. Should I be releasing st_offset_vector between regex.pcreReplaceCallback statements? I get errors if I do that. Everything works fine if I omit releases, but I wonder if I'm failing to reclaim memory. All my callback routines have the argument pCaptureVec, and the same "boilerplace" at the top:
Function callback1(pCaptureVec) local dll_status static st_iCaptures, st_offset_vec, st_nVecItems st_sSubject if (length(st_offset_vec)) do st_offset_vec.dereference(pCaptureVec) else static st_nVecItems = number ;;where number is a fixed number that varies for each callback routine st_offset_vec = dll.create_array(pCaptureVec, st_nVecItems, "int") endif
