Assertion failed: cannot call main when async dependencies remain! (listen on __ATMAIN__)

308 views
Skip to first unread message

wolfviking0

unread,
Jul 30, 2014, 8:59:49 AM7/30/14
to emscripte...@googlegroups.com
Hi,

I have sometime this error when I start my 3D Engine.

Inside my JS settings I use this Module['noInitialRun'] = true; for choose when I want start the Engine. 

I call Module['callMain'](Module['arguments']); for launch.

May be I don't use rightly the function. Any suggestion about this error ?

Tony

Alon Zakai

unread,
Jul 30, 2014, 6:03:44 PM7/30/14
to emscripte...@googlegroups.com
You should only call main() when things are ready to execute, and some things are asynchronous (like file preloading, or the .mem init file loading), so this can be confusing. It is therefore best to let emscripten call main for you, instead of doing it yourself. If you want to do it yourself, the best way is to replace your main() with a function that notifies you it is ok to call main(), and then you can call your real main some time after that (but not before).

- Alon



--
You received this message because you are subscribed to the Google Groups "emscripten-discuss" group.
To unsubscribe from this group and stop receiving emails from it, send an email to emscripten-disc...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Giovanni Parra

unread,
Feb 14, 2018, 9:13:00 AM2/14/18
to emscripten-discuss
How can I know if it is ok to call main?
Is there something my JS code can listen to that will notify me that I can call main?
Or should I just call main repeatedly until it works?
To unsubscribe from this group and stop receiving emails from it, send an email to emscripten-discuss+unsub...@googlegroups.com.

Alon Zakai

unread,
Feb 14, 2018, 10:30:34 AM2/14/18
to emscripten-discuss

To unsubscribe from this group and stop receiving emails from it, send an email to emscripten-discuss+unsubscribe@googlegroups.com.

For more options, visit https://groups.google.com/d/optout.
Reply all
Reply to author
Forward
0 new messages