std::string ResourceUIScriptRuntime::AddCallbackRef(ResUIResultCallback resultCallback) { std::unique_lock<std::recursive_mutex> lock(m_refMutex); // add the ref to the list int32_t idx = m_refIdx; m_refs[idx] = resultCallback; m_refIdx++; // canonicalize the ref char* refString; m_scriptHost->CanonicalizeRef(idx, GetInstanceId(), &refString); // turn into a std::string and free std::string retval = refString; fwFree(refString); // return the value return retval; }
void fwsFree(void* ptr) { fwFree(ptr); }