API:Known CTDs

From TheWarWiki

Jump to: navigation, search

This page is intended to document CTDs (Crash To Desktop) bugs that have been spotted, and possibly the workaround for them. This is done in the hope of saving time and frustration to other addon authors.

Remember that other than your own infinite recursion or infinite loops, any normal call to the WAR API that results in a CTD is considered a bug, as the lua engine should be running in a sandbox, i.e it should not crash the hosting application. Don't record anything that is the result of your own bad lua code, i.e infinite loops, infinite recursion, huge variables, etc. Only simple calls to WAR API functions that result in a CTD.

Contents

TextEditBoxSetText()

TextEditBoxSetText() causes a CTD if you use it before loading is done (i.e during initialize).

Workaround: wait for LOADING_END or INTERFACE_RELOADED and use it then.

Anchoring

Anchoring something to itself causes a CTD.

Workaround: Don't do it.

TextLogLoadFromFile()

Since: 1.2 If you load a file with TextLogLoadFromFile() and the file only contains the \r\n war crashes.

If you do a TextLogSetIncrementalSaving a almost "empty" file with only \r\n in it will be created.

Next time you try to load it, CTD.

Workaround: After you use TextLogSetIncrementalSaving() check with TextLogGetNumEntries() if there are lines in it if not simple add a empty string with TextLogAddEntry() to the textlog. You also should do this (adding the empty string) after doing a TextLogClear()

Anchoring Out Of Hierarchy

Since: 1.2

You will get a CTD on /reloadui if you anchor a window to another which is out of its hierarchy.

For example:

  • Create windowA and windowB with "Root" as the parent
  • Create windowC with windowB as the parent
  • Anchor windowA to windowC
Personal tools