mirror of
https://github.com/immense/Remotely.git
synced 2025-10-26 11:27:15 +00:00
Minor tweaks.
This commit is contained in:
parent
b3c0380e1f
commit
20df55882c
@ -119,14 +119,8 @@ namespace Remotely_ScreenCast.Core.Capture
|
||||
}
|
||||
finally
|
||||
{
|
||||
try
|
||||
{
|
||||
currentFrame.UnlockBits(bd1);
|
||||
previousFrame.UnlockBits(bd2);
|
||||
bd1 = null;
|
||||
bd2 = null;
|
||||
}
|
||||
catch { }
|
||||
currentFrame.UnlockBits(bd1);
|
||||
previousFrame.UnlockBits(bd2);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@ -7,6 +7,7 @@ using System.Collections.Generic;
|
||||
using System.Drawing;
|
||||
using System.IO;
|
||||
using System.Linq;
|
||||
using System.Runtime.InteropServices;
|
||||
using System.Text;
|
||||
using System.Threading.Tasks;
|
||||
|
||||
@ -103,15 +104,18 @@ namespace Remotely_ScreenCast.Core.Capture
|
||||
await conductor.CasterSocket.SendScreenCapture(encodedImageBytes, viewerID, diffArea.Left, diffArea.Top, diffArea.Width, diffArea.Height, DateTime.UtcNow);
|
||||
viewer.PendingFrames++;
|
||||
}
|
||||
// TODO: Even after disposing of the bitmap, GC doesn't collect in time. Memory usage soars quickly.
|
||||
// Need to revisit this later.
|
||||
GC.Collect();
|
||||
}
|
||||
}
|
||||
catch (Exception ex)
|
||||
{
|
||||
Logger.Write(ex);
|
||||
}
|
||||
finally
|
||||
{
|
||||
// TODO: Even after disposing of the bitmap, GC doesn't collect in time. Memory usage soars quickly.
|
||||
// Need to revisit this later.
|
||||
GC.Collect();
|
||||
}
|
||||
}
|
||||
Logger.Write($"Ended screen cast. Requester: {requesterName}. Viewer ID: {viewerID}.");
|
||||
success = false;
|
||||
|
||||
Loading…
Reference in New Issue
Block a user