@nativescript/windows 0.1.0-alpha.78 → 0.1.0-alpha.79

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -42,6 +42,7 @@ public static partial class Bridge
42
42
  try
43
43
  {
44
44
  Marshal.Release(new IntPtr(nativePtr));
45
+ try { System.Diagnostics.Debug.WriteLine($"[Bridge] Binary __release: Released native ptr for handle {handleToRemove} -> 0x{nativePtr:x}"); } catch { }
45
46
  }
46
47
  catch
47
48
  {
@@ -27,6 +27,7 @@ public static partial class Bridge
27
27
  try
28
28
  {
29
29
  Marshal.Release(new IntPtr(nativePtr));
30
+ try { System.Diagnostics.Debug.WriteLine($"[Bridge] __release: Released native ptr for handle {id} -> 0x{nativePtr:x}"); } catch { }
30
31
  }
31
32
  catch
32
33
  {
@@ -272,6 +273,7 @@ public static partial class Bridge
272
273
  if (p != IntPtr.Zero)
273
274
  {
274
275
  s_nativePtrs[id] = p.ToInt64();
276
+ try { System.Diagnostics.Debug.WriteLine($"[Bridge] Box: handle {id}, type={t.FullName}, native=0x{p.ToInt64():x}"); } catch { }
275
277
  }
276
278
  }
277
279
  }
@@ -1,4 +1,5 @@
1
1
  using System;
2
+ using System.Diagnostics;
2
3
  using System.Collections.Concurrent;
3
4
  using System.Collections.Generic;
4
5
  using System.IO;
@@ -385,7 +386,10 @@ public static partial class Bridge
385
386
  public static long GetNativePtrForHandle(int handleId)
386
387
  {
387
388
  if (handleId <= 0) return 0;
388
- if (s_nativePtrs.TryGetValue(handleId, out var p)) return p;
389
+ if (s_nativePtrs.TryGetValue(handleId, out var p)) {
390
+ try { Debug.WriteLine($"[Bridge] GetNativePtrForHandle({handleId}) -> 0x{p:x} (cached)"); } catch { }
391
+ return p;
392
+ }
389
393
 
390
394
  if (!s_handles.TryGetValue(handleId, out var obj) || obj == null)
391
395
  return 0;
@@ -397,14 +401,16 @@ public static partial class Bridge
397
401
  {
398
402
  var val = ip.ToInt64();
399
403
  s_nativePtrs[handleId] = val;
404
+ try { Debug.WriteLine($"[Bridge] GetNativePtrForHandle({handleId}) -> 0x{val:x} (new)"); } catch { }
400
405
  return val;
401
406
  }
402
407
  }
403
- catch
408
+ catch (Exception ex)
404
409
  {
405
- // best-effort: not a COM object or failed to obtain native ptr
410
+ try { Debug.WriteLine($"[Bridge] GetNativePtrForHandle({handleId}) threw: {ex}"); } catch { }
406
411
  }
407
412
 
413
+ try { Debug.WriteLine($"[Bridge] GetNativePtrForHandle({handleId}) -> 0 (none)"); } catch { }
408
414
  return 0;
409
415
  }
410
416
 
Binary file
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@nativescript/windows",
3
- "version": "0.1.0-alpha.78",
3
+ "version": "0.1.0-alpha.79",
4
4
  "description": "NativeScript for using Windows v8",
5
5
  "repository": {
6
6
  "type": "git",