Add a remark to thread enter warning

This commit is contained in:
Ruslan Mustakov 2018-05-14 21:15:11 +07:00
commit a1d1481967
2 changed files with 6 additions and 2 deletions

View file

@ -1,4 +1,4 @@
version = "0.7.9" version = "0.7.10"
author = "Xored Software, Inc." author = "Xored Software, Inc."
description = "Godot Engine bindings" description = "Godot Engine bindings"
license = "MIT" license = "MIT"

View file

@ -823,6 +823,8 @@ proc registerFrameCallback*(cb: proc () {.closure.}) =
else: else:
idleCallbacks.add(cb) idleCallbacks.add(cb)
{.push stackTrace: off.}
proc godot_nativescript_frame() {.cdecl, exportc, dynlib.} = proc godot_nativescript_frame() {.cdecl, exportc, dynlib.} =
var stackBottom {.volatile.}: pointer var stackBottom {.volatile.}: pointer
{.emit: """ {.emit: """
@ -840,7 +842,7 @@ proc godot_nativescript_thread_enter() {.cdecl, exportc, dynlib.} =
when compileOption("threads"): when compileOption("threads"):
setupForeignThreadGc() setupForeignThreadGc()
else: else:
const err = cstring"A foreign thread is created, but app is compiled without --threads:on. Bad things will happen if Nim code is invoked from this thread." const err = cstring"A foreign thread is created, but app is compiled without --threads:on. Bad things will happen if Nim code is invoked from this thread. If you see this warning when running the editor and you don't actually use threads, ignore it."
var s = err.toGodotString() var s = err.toGodotString()
godotPrint(s) godotPrint(s)
s.deinit() s.deinit()
@ -848,3 +850,5 @@ proc godot_nativescript_thread_enter() {.cdecl, exportc, dynlib.} =
proc godot_nativescript_thread_exit() {.cdecl, exportc, dynlib.} = proc godot_nativescript_thread_exit() {.cdecl, exportc, dynlib.} =
when compileOption("threads"): when compileOption("threads"):
teardownForeignThreadGc() teardownForeignThreadGc()
{.pop.} # stackTrace: off