# Resource.set\_texture example code crashes \[FIXED\]

**URL:** <https://forum.defold.com/t/resource-set-texture-example-code-crashes-fixed/71207>\
**Category:** Bugs\
**Created:** [July 5, 2022, 11:54am UTC](https://forum.defold.com/t/resource-set-texture-example-code-crashes-fixed/71207 "2022-07-05T11:54:11Z")\
**Posts on this page:** 5\
**Page:** 1

<div class="post-metadata">

**Author:** ![benjames171](https://forum-defold.b-cdn.net/user_avatar/forum.defold.com/benjames171/32/34759_2.png) [@benjames171](https://forum.defold.com/u/benjames171)\
**Post date:** [July 5, 2022, 11:54am UTC](https://forum.defold.com/t/resource-set-texture-example-code-crashes-fixed/71207/1 "2022-07-05T11:54:11Z")

</div>

Running the example code from [Defold API ref here](https://defold.com/ref/beta/resource/#resource.set_texture:path-table-buffer) results in a crash.

I’ve tried an old project of mine that used to work but now crashes when running similar code.

Crash occurs on the final line of the example when calling `resource.set_texture`

[\_crash.dmp.txt](https://forum.defold.com/uploads/short-url/mkwY5qgNa0uEc81w1miGNBCy9ep.txt) (117.2 KB)  
[\_crash.txt](https://forum.defold.com/uploads/short-url/igZMY3Gu0wq8Yxfjn0cEc6ZsQ4n.txt) (50.0 KB)

---

<div class="post-metadata">

**Author:** ![Mathias\_Westerdahl](https://forum-defold.b-cdn.net/user_avatar/forum.defold.com/mathias_westerdahl/32/228_2.png) [@Mathias\_Westerdahl](https://forum.defold.com/u/Mathias_Westerdahl)\
**Post date:** [July 5, 2022, 12:00pm UTC](https://forum.defold.com/t/resource-set-texture-example-code-crashes-fixed/71207/2 "2022-07-05T12:00:13Z")

</div>

Thanks for the report!  
I’m working on it right now.  
In the meantime, I recommend using version 1.3.3.

---

<div class="post-metadata">

**Author:** ![Mathias\_Westerdahl](https://forum-defold.b-cdn.net/user_avatar/forum.defold.com/mathias_westerdahl/32/228_2.png) [@Mathias\_Westerdahl](https://forum.defold.com/u/Mathias_Westerdahl)\
**Post date:** [July 5, 2022, 1:01pm UTC](https://forum.defold.com/t/resource-set-texture-example-code-crashes-fixed/71207/3 "2022-07-05T13:01:16Z")

</div>

We have a fix building now, will make an updated release as soon as it has built on CI.

---

<div class="post-metadata">

**Author:** ![benjames171](https://forum-defold.b-cdn.net/user_avatar/forum.defold.com/benjames171/32/34759_2.png) [@benjames171](https://forum.defold.com/u/benjames171)\
**Post date:** [July 5, 2022, 1:30pm UTC](https://forum.defold.com/t/resource-set-texture-example-code-crashes-fixed/71207/4 "2022-07-05T13:30:11Z")

</div>

Thank you!

---

<div class="post-metadata">

**Author:** ![Mathias\_Westerdahl](https://forum-defold.b-cdn.net/user_avatar/forum.defold.com/mathias_westerdahl/32/228_2.png) [@Mathias\_Westerdahl](https://forum.defold.com/u/Mathias_Westerdahl)\
**Post date:** [July 5, 2022, 3:04pm UTC](https://forum.defold.com/t/resource-set-texture-example-code-crashes-fixed/71207/5 "2022-07-05T15:04:55Z")

</div>

The latest release should now be working again (engine sha1: 80b1b73fd9cdbd4682c2583403fddfbaf0919107)
