Skip to content

Commit d79bbf2

Browse files
authored
fix(rrweb): Do not re-initialize worker in CanvasManager.reset (#221)
`reset()` gets called when we stop a recording in progress. There is no reason to re-initialize the worker in `reset()` as you would need to call `record()` to start recording again, which would start a new worker. This was introduced in #168.
1 parent ddb3a56 commit d79bbf2

File tree

1 file changed

+0
-7
lines changed

1 file changed

+0
-7
lines changed

packages/rrweb/src/record/observers/canvas/canvas-manager.ts

-7
Original file line numberDiff line numberDiff line change
@@ -123,13 +123,6 @@ export class CanvasManager implements CanvasManagerInterface {
123123
this.worker?.terminate();
124124
this.worker = null;
125125
this.snapshotInProgressMap = new Map();
126-
if (
127-
(this.options.recordCanvas &&
128-
typeof this.options.sampling === 'number') ||
129-
this.options.enableManualSnapshot
130-
) {
131-
this.worker = this.initFPSWorker();
132-
}
133126
}
134127

135128
public freeze() {

0 commit comments

Comments
 (0)