You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
This repository has been archived by the owner on Nov 3, 2023. It is now read-only.
I worked around this by calling the native method directly, using a similar implementation but without the using statement and a pointer check. It now works 100% of the time (i.e. I'm getting all the logs, its never missing the if check) so I therefor believe its something to do with the using statement - possibly a CLR optimisation that's not realising the Handle accessor requires the string to be kept around for the lifetime of the using statement?
[DllImport("__Internal", EntryPoint = "TFLog")]
private extern static void WrappedTFLog(IntPtr handle);
private static void Log (string msg)
{
var nss = new NSString(msg);
var handle = nss.Handle;
if ( handle != (IntPtr) 0xffffffff )
WrappedTFLog(nss.Handle);
}
Sign up for freeto subscribe to this conversation on GitHub.
Already have an account?
Sign in.
I'm getting very weird intermittent app crashes on release builds of my app.
Is that
0xffffffff
the address of the NSString parameter passed to the WrapperTfLog method? Or is it the address of the method itself?If its the first, then it appears that the
mss.Handle
is returning an invalid0xffffffff
handle on the newly constructed NSString. Very weird.If the latter, it makes no sense as this is not the first log call. The app has been logging just fine directly before this failure.
The text was updated successfully, but these errors were encountered: