Trying to count procedure calls at the time a mock object gets destroyed. But I 
cannot get any simple code running. Please explain the syntax of finalizers for 
**ref** types.
    
    
    type
      A = ref object
    
    proc finalizer(a: A) =
      echo "---------------------------------------------"
    
    proc foo(): A =
      var a {.global.}: A = A()
      new(a, finalizer)
      return a
    
    var a = foo()
    GC_fullCollect()
    
    
    Run

Reply via email to