[runtime] Pass value callbacks to free values when creating the 'gchandle_hash' dictionary. (#13109)
This way the values are actually freed.
This commit is contained in:
Родитель
00ea033536
Коммит
fad9779840
|
@ -834,9 +834,9 @@ xamarin_set_gchandle_trampoline (id self, SEL sel, GCHandle gc_handle, enum Xama
|
||||||
|
|
||||||
pthread_mutex_lock (&gchandle_hash_lock);
|
pthread_mutex_lock (&gchandle_hash_lock);
|
||||||
if (gchandle_hash == NULL) {
|
if (gchandle_hash == NULL) {
|
||||||
CFDictionaryValueCallBacks value_callbacks;
|
CFDictionaryValueCallBacks value_callbacks = { 0 };
|
||||||
value_callbacks.release = release_gchandle_dictionary_entry;
|
value_callbacks.release = release_gchandle_dictionary_entry;
|
||||||
gchandle_hash = CFDictionaryCreateMutable (kCFAllocatorDefault, 0, NULL, NULL);
|
gchandle_hash = CFDictionaryCreateMutable (kCFAllocatorDefault, 0, NULL, &value_callbacks);
|
||||||
}
|
}
|
||||||
if (gc_handle == INVALID_GCHANDLE) {
|
if (gc_handle == INVALID_GCHANDLE) {
|
||||||
CFDictionaryRemoveValue (gchandle_hash, self);
|
CFDictionaryRemoveValue (gchandle_hash, self);
|
||||||
|
|
Загрузка…
Ссылка в новой задаче