Skip to content

Commit

Permalink
Merge pull request #383 from hawk86104/useDracoLoaderAutoDispose
Browse files Browse the repository at this point in the history
feat(cientos): auto useDracoLoaderDispose in useGLTF
  • Loading branch information
JaimeTorrealba authored Apr 16, 2024
2 parents aa86851 + 1c710dd commit e71bc7f
Showing 1 changed file with 4 additions and 5 deletions.
9 changes: 4 additions & 5 deletions src/core/loaders/useGLTF/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -68,9 +68,8 @@ export async function useGLTF<T extends string | string[]>(
},
extendLoader?: (loader: GLTFLoader) => void,
): Promise<T extends string[] ? GLTFResult[] : GLTFResult> {
return await useLoader(
GLTFLoader,
path,
setExtensions(options, extendLoader),
)
const gltfModel = (await useLoader(GLTFLoader, path, setExtensions(options, extendLoader))) as unknown as GLTFResult
dracoLoader?.dispose()
dracoLoader = null
return gltfModel
}

0 comments on commit e71bc7f

Please sign in to comment.