예제 #1
0
 void Dispose(bool disposing)
 {
     if (!IsEmpty)
     {
         if (disposing)
         {
             // de-reference the managed resource.
             PPBCore.ReleaseResource(this);
         }
         ppresource = 0; // set ourselves to empty
     }
 }
예제 #2
0
 /// <summary>
 /// Method that will release all the PPResource's that have been placed on the queue to be released.
 /// </summary>
 /// <param name="result"></param>
 void ReleasePump(PPError result)
 {
     if (!resourceReleaseQueue.IsEmpty)
     {
         object resourceToBeReleased;
         while (resourceReleaseQueue.TryDequeue(out resourceToBeReleased))
         {
             if (resourceToBeReleased is PPResource)
             {
                 PPBCore.ReleaseResource((PPResource)resourceToBeReleased);
             }
             else if (resourceToBeReleased is PPVar)
             {
                 PPBVar.Release((PPVar)resourceToBeReleased);
             }
         }
     }
     PPBCore.CallOnMainThread(releaseLoopTime, new CompletionCallback(ReleasePump), releaseLoopTime);
 }
예제 #3
0
파일: Core.cs 프로젝트: vzolotov/WebSharp
 /// <summary>
 /// ReleaseResource() decrements the reference count for the provided
 /// <code>resource</code>. The resource will be deallocated if the
 /// reference count reaches zero.
 /// </summary>
 /// <param name="resource">A <code>Resource</code> corresponding to a
 /// resource.</param>
 public static void ReleaseResource(Resource resource) => PPBCore.ReleaseResource(resource);