We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
传参结构体param_c在构建时为channel_ext_分配内存,调用完成后,仅针对param_c释放,未针对channel_ext_释放,存在内存泄露问题,请确认。
param_c
channel_ext_
public static NIMSignalingCreateParam_C GetNativeNIMSignalingCreateParam(NIMSignalingCreateParam param) { NIMSignalingCreateParam_C param_c = new NIMSignalingCreateParam_C(); if(param!=null) { param_c.channel_ext_ = Utf8StringMarshaler.GetInstance("").MarshalManagedToNative(param.channel_ext_); param_c.channel_name_= Utf8StringMarshaler.GetInstance("").MarshalManagedToNative(param.channel_name_); param_c.channel_type_ = param.channel_type_; } return param_c; }
public static void SignalingCreate(NIMSignalingCreateParam param, NimSignalingOptCreateHandler cb) { NIMSignalingCreateParam_C param_c = SignalHelper.GetNativeNIMSignalingCreateParam(param); int nSizeOfParam = Marshal.SizeOf(param_c); IntPtr param_ptr = Marshal.AllocHGlobal(nSizeOfParam); try { Marshal.StructureToPtr(param_c, param_ptr, false); var user_ptr = NimUtility.DelegateConverter.ConvertToIntPtr(cb); SignalingNativeMethods.nim_signaling_create(param_ptr, NimSignalingCreateCb, user_ptr); } catch (Exception) { cb?.Invoke(NIMSignalingCreateResCode.kAbnormal, null); } finally { Marshal.FreeHGlobal(param_ptr); } }
The text was updated successfully, but these errors were encountered:
No branches or pull requests
传参结构体
param_c
在构建时为channel_ext_
分配内存,调用完成后,仅针对param_c
释放,未针对channel_ext_
释放,存在内存泄露问题,请确认。The text was updated successfully, but these errors were encountered: