| FazBrowse GitHub Viewer | Trending | | Home |
| Tools: [Download Repo ZIP] [Original HTTPS Page] |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -75,7 +75,8 @@ internal ClassDerivedObject(Type tp) : base(tp) | |||
| 75 | 75 | // So we don't call PyObject_GC_Del here and instead we set the python | |
| 76 | 76 | // reference to a weak reference so that the C# object can be collected. | |
| 77 | 77 | GCHandle gc = GCHandle.Alloc(self, GCHandleType.Weak); | |
| 78 | - Marshal.WriteIntPtr(self.pyHandle, ObjectOffset.magic(self.tpHandle), (IntPtr)gc); | ||
| 78 | + int gcOffset = ObjectOffset.magic(Runtime.PyObject_TYPE(self.pyHandle)); | ||
| 79 | + Marshal.WriteIntPtr(self.pyHandle, gcOffset, (IntPtr)gc); | ||
| 79 | 80 | self.gcHandle.Free(); | |
| 80 | 81 | self.gcHandle = gc; | |
| 81 | 82 | } | |
| Back | FazBrowse Home | New Git URL |
0 commit comments