Skip to content

Commit

Permalink
Merge pull request #1397 from VisActor/fix/event-memory
Browse files Browse the repository at this point in the history
fix: fix issue with event menory
  • Loading branch information
xile611 authored Aug 27, 2024
2 parents 6313aff + da78ecb commit f3679c0
Showing 1 changed file with 8 additions and 0 deletions.
8 changes: 8 additions & 0 deletions packages/vrender-core/src/event/event-system.ts
Original file line number Diff line number Diff line change
Expand Up @@ -186,6 +186,8 @@ export class EventSystem {
}

this.setCursor(this.manager.cursor, this.manager.cursorTarget);
// 避免内存泄露
this.rootPointerEvent.nativeEvent = null;
};

private onPointerMove = (nativeEvent: NativeEvent): void => {
Expand All @@ -205,6 +207,8 @@ export class EventSystem {
}

this.setCursor(this.manager.cursor, this.manager.cursorTarget);
// 避免内存泄露
this.rootPointerEvent.nativeEvent = null;
};

private onPointerUp = (nativeEvent: NativeEvent): void => {
Expand All @@ -224,6 +228,8 @@ export class EventSystem {
}

this.setCursor(this.manager.cursor, this.manager.cursorTarget);
// 避免内存泄露
this.rootPointerEvent.nativeEvent = null;
};

private onPointerOverOut = (nativeEvent: NativeEvent): void => {
Expand All @@ -240,6 +246,8 @@ export class EventSystem {
}

this.setCursor(this.manager.cursor, this.manager.cursorTarget);
// 避免内存泄露
this.rootPointerEvent.nativeEvent = null;
};

protected onWheel = (nativeEvent: WheelEvent): void => {
Expand Down

0 comments on commit f3679c0

Please sign in to comment.