Skip to content

Commit

Permalink
feat(AnimatedSprite): dispose texture onUnmounted
Browse files Browse the repository at this point in the history
  • Loading branch information
andretchen0 committed Apr 7, 2024
1 parent 7a14b55 commit 18d6904
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion src/core/abstractions/AnimatedSprite/component.vue
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
<script setup lang="ts">
import { ref, watch } from 'vue'
import { onUnmounted, ref, watch } from 'vue'
import type { TresVector2 } from '@tresjs/core'
import { useRenderLoop, normalizeVectorFlexibleParam } from '@tresjs/core'
import type { Intersection } from 'three'
Expand Down Expand Up @@ -199,6 +199,10 @@ watch(() => [props.definitions], () => {
frameNum = 0
render()
}, { immediate: true })
onUnmounted(() => {
texture.dispose()
})
</script>

<template>
Expand Down

0 comments on commit 18d6904

Please sign in to comment.