Changed the deinit call to an unref to prevent a wrong free

This fixes a free of a stackalloced value