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
Runtime.NSLog($"{GetType().Name}.GetData (): id={objectId} no handle\n{Environment.StackTrace}");
193
+
thrownewObjectDisposedException($"{GetType().Name}.GetData (): id={objectId} No data???");
194
+
#else
172
195
// Throwing an exception here is better than returning a null pointer, because that will crash the process when the pointer is dereferenced
173
196
// (and none of the callers can do anything useful with a null pointer anyway).
174
197
thrownewObjectDisposedException($"This object (of type {GetType().Name}) does not have a data pointer anymore, possibly because of a race condition. Please file a bug at https://github.com/dotnet/macios/issues.");
if(!Runtime.IsCoreCLR)// This condition (and the assignment to __handle_for_mono if applicable) is trimmed away by the linker.
195
227
__data_for_mono=data.Data;
196
228
@@ -1053,7 +1085,7 @@ void RecreateDataHandle ()
1053
1085
// else does that, it's quite unlikely this instance will become resurrected a second time.
1054
1086
varprevious_data=data_handle;
1055
1087
if(previous_dataisnull){
1056
-
varmsg=$"This object (of type {GetType().Name}) does not have an existing data pointer, possibly because of a race condition. Please file a bug at https://github.com/dotnet/macios/issues.");
1088
+
varmsg=$"This object (of type {GetType().Name}) does not have an existing data pointer, possibly because of a race condition. Please file a bug at https://github.com/dotnet/macios/issues.";
1057
1089
#if CONSISTENCY_CHECKS
1058
1090
thrownewInvalidOperationException(msg);
1059
1091
#else
@@ -1067,7 +1099,7 @@ void RecreateDataHandle ()
1067
1099
}
1068
1100
1069
1101
if(previous_data.IsInvalid){
1070
-
varmsg=$"This object (of type {GetType().Name}) does not have valid data pointer, possibly because of a race condition. Please file a bug at https://github.com/dotnet/macios/issues.");
1102
+
varmsg=$"This object (of type {GetType().Name}) does not have valid data pointer, possibly because of a race condition. Please file a bug at https://github.com/dotnet/macios/issues.";
1071
1103
#if CONSISTENCY_CHECKS
1072
1104
thrownewInvalidOperationException(msg);
1073
1105
#else
@@ -1076,6 +1108,9 @@ void RecreateDataHandle ()
1076
1108
#endif
1077
1109
}
1078
1110
1111
+
#if LOGGING
1112
+
Runtime.NSLog($"{GetType().Name}: id={objectId} previous value invalidated and disposed. Current flags: {flags}");
1113
+
#endif
1079
1114
previous_data.Invalidate();
1080
1115
// Don't dispose previous_data, because another thread might be referencing it, and trying to access its pointer - which is still valid.
1081
1116
// The GC will dispose of previous_data when its not accessible anymore.
0 commit comments