Skip to content
GitLab
Menu
Projects
Groups
Snippets
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Menu
Open sidebar
BC
public
liblinphone
Commits
1d865de8
Commit
1d865de8
authored
May 09, 2017
by
Sylvain Berfini
🐮
Browse files
Fix iOS crash with null GCHandles
parent
0e58a367
Changes
1
Hide whitespace changes
Inline
Side-by-side
wrappers/csharp/wrapper_impl.mustache
View file @
1d865de8
...
...
@@ -122,9 +122,9 @@ namespace Linphone
~LinphoneObject()
{
//Console.WriteLine("Destroying" + this.ToString());
//Console.WriteLine("Destroying
" + this.ToString());
if (nativePtr != IntPtr.Zero) {
//Console.WriteLine("Unreffing" + this.ToString());
//Console.WriteLine("Unreffing
" + this.ToString());
belle_sip_object_unref(nativePtr);
}
}
...
...
@@ -136,14 +136,14 @@ namespace Linphone
if (objPtr == IntPtr.Zero)
{
T obj = new T();
//Console.WriteLine("Creating" + obj.ToString());
//Console.WriteLine("Creating
" + obj.ToString());
if (takeRef)
{
ptr = belle_sip_object_ref(ptr);
//Console.WriteLine("Reffing" + obj.ToString());
//Console.WriteLine("Reffing
" + obj.ToString());
}
obj.nativePtr = ptr;
GCHandle handle = GCHandle.Alloc(obj, GCHandleType.Weak);
GCHandle handle = GCHandle.Alloc(obj, GCHandleType.Weak
TrackResurrection
);
objPtr = GCHandle.ToIntPtr(handle);
belle_sip_object_data_set(ptr, "cs_obj", objPtr, onDataDestroyed);
return obj;
...
...
@@ -152,11 +152,7 @@ namespace Linphone
{
GCHandle handle = GCHandle.FromIntPtr(objPtr);
T obj = (T)handle.Target;
if (takeRef)
{
obj.nativePtr = belle_sip_object_ref(obj.nativePtr);
//Console.WriteLine("Reffing" + obj.ToString());
}
//Console.WriteLine("Using existing " + obj.ToString());
return obj;
}
}
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment