Skip to content

Commit

Permalink
fix: don't access invalid memory to prevent crash
Browse files Browse the repository at this point in the history
  • Loading branch information
DiscreteTom committed Jun 2, 2023
1 parent eba3b45 commit 13b3443
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 0 deletions.
4 changes: 4 additions & 0 deletions Assets/HDD/Scripts/HDD_Monitor.cs
Original file line number Diff line number Diff line change
Expand Up @@ -96,6 +96,10 @@ async void TakeCapture() {
try {
var res = await client.TakeCaptureAsync(new Shremdup.TakeCaptureRequest { Id = (uint)this.id });

// don't access memory if this is destroyed
// to avoid crash
if (this.destroyed) return;

if (res.DesktopUpdated) {
// load from shared memory
texture.LoadRawTextureData(address, bufSize);
Expand Down
4 changes: 4 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,9 @@
# CHANGELOG

## v1.2.1

- Enhance stability.

## v1.2.0

- Feat: `HDD_Manager.Refresh` will restart shremdup service.
Expand Down

0 comments on commit 13b3443

Please sign in to comment.