Skip to content

Commit c8a933e

Browse files
authored
fix: prevent premature draw calls and destroy encoding texture prior to recreation (#208)
* fix: prevent premature `draw()` calls * fix: destroy the encoding texture before recreating it In addition, this commit: - rejects `set()` if the instance was destroyed - ensures unnecessary texture updates are avoided - color and encoding textures are destroyed upon calling `scatterplot.destroy()` - fixes a small memory leak in the newly added advanced exporter where I forgot to unsubscribe a draw listener. * chore: remove unused `catchError()`
1 parent 27ce203 commit c8a933e

File tree

8 files changed

+290
-153
lines changed

8 files changed

+290
-153
lines changed

CHANGELOG.md

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,11 @@
1+
## 1.12.1
2+
3+
- Fix: destroy the encoding texture before recreating it
4+
- Fix: reject `set()` calls if the instance was destroyed
5+
- Fix: ensures unnecessary color and encoding texture updates are avoided
6+
- Fix: color and encoding textures are destroyed upon calling `scatterplot.destroy()`
7+
- Fix: prevent a minor memory leak in the newly added advanced exporter
8+
19
## 1.12.0
210

311
- Feat: add support for adjusting the anti-aliasing via `scatterplot.set({ antiAliasing: 1 })`. ([#175](https://github.com/flekschas/regl-scatterplot/issues/175))

src/constants.js

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -172,3 +172,6 @@ export const DEFAULT_PIXEL_ALIGNED = false;
172172

173173
// Error messages
174174
export const ERROR_POINTS_NOT_DRAWN = 'Points have not been drawn';
175+
export const ERROR_INSTANCE_IS_DESTROYED = 'The instance was already destroyed';
176+
export const ERROR_IS_DRAWING =
177+
'Ignoring draw call as the previous draw call has not yet finished. To avoid this warning `await` the draw call.';

0 commit comments

Comments
 (0)