Ejemplo n.º 1
0
        void MemoryUpdateEvent(object sender, MemoryUpdateEventArgs args)
        {
            List <WeakReference> deadStreams = new List <WeakReference>();

            lock (mMemoryReaders)
            {
                foreach (WeakReference memStreamRef in mMemoryReaders)
                {
                    DebugMemoryStream memStream = memStreamRef.Target as DebugMemoryStream;

                    if (memStream == null)
                    {
                        deadStreams.Add(memStreamRef);
                        continue;
                    }

                    memStream.Update(args.Address, args.Memory);
                }

                foreach (WeakReference deadref in deadStreams)
                {
                    mMemoryReaders.Remove(deadref);
                }
            }
        }
Ejemplo n.º 2
0
 public DebugMemoryStream NewMemoryStream()
 {
     lock (mMemoryReaders)
     {
         DebugMemoryStream dms = new DebugMemoryStream(this);
         mMemoryReaders.Add(new WeakReference(dms));
         return(dms);
     }
 }