KnownBugs

From X-Plane SDK
Jump to: navigation, search
This page was imported from the previous wiki engine. It needs a review and cleanup of formatting. Please see this page for more information.
!!! X-Plane SDK known bugs.

This page describes known bugs in the X-Plane SDK.

! XPLMGetDirectoryContents can overwrite memory (Fixed in X-Plane 7.40)

Before X-Plane 7.40, XPLMGetDirectoryContents did not respect the number of pointers that are provided to hold the incoming directory items. This can cause XPLMGetDirectoryContents to overwrite memory. You can work around this by limiting the amount of raw character memory passed to the function and calling XPLMGetDirectoryContents multiple times:

char format[512]; char path[512]; char nameBuf[4096]; char * indices[4096]; long retFile; long totFile; int retVal; int n; int offset = 0; int total = 0; char * sysFolder; XPLMGetSystemPath(path); XPLMDebugString("Dumping dir: "); XPLMDebugString(path); XPLMDebugString("\n"); while (1) { retVal = XPLMGetDirectoryContents(path, offset, nameBuf, sizeof(nameBuf), indices, sizeof(indices) / sizeof(char *), &totFile, &retFile); sprintf(format,"Result = %d, got %d of %d files.\n", retVal, retFile, totFile); total += retFile; XPLMDebugString(format); for (n = 0; n < retFile; ++n) { XPLMDebugString(indices[n]); XPLMDebugString("\n"); } if (retVal) break; else offset += retFile; }


! Some null characters cause the edit-text widget to crash (Fixed in X-Plane 7.10)

Before X-Plane 7.10, typing multiple unprintable characters into the standard editable text widget could cause X-Plane to crash. You can work around this bug and be safe on all versions of x-plane by adding the following widget callback to your text widgets:

static	int	WidgetFunc_EatNullChars(
                                  XPWidgetMessage      inMessage,
                                  XPWidgetID           inWidget,
                                  long                 inParam1,
                                  long                 inParam2)
{

if (inMessage == xpMsg_KeyPress) { char theChar = KEY_CHAR(inParam1);

if (theChar == 0) return 1; // Eat the null char! } return 0;

}

XPAddWidgetCallback(inWidgetID, WidgetFunc_EatNullChars);

! Wrong flags sent to key sniffers and other key handlers (Fixed in X-Plane 7.40) Pre X-Plane 7.40 on Windows only, the auto-repeat key message is sent with the xplm_DownFlag bit still set (this flag should only be set once for the initial key press). You can track the messages yourself to work around this pre-7.40 if you need to detect only the first key press and not an auto repeat ; exactly one up message is still sent when the key is released.

! Modifier keys get stuck on Windows when a dialog box is pulled up (Fixed in X-Plane 7.40) Pre X-Plane 7.40 if you used a control-key command to bring up a dialog box and then closed the dialog box, plugins would act as if the control key was "stuck on" until the control key was pressed and released. There is no workaround for this but users can avoid the problem by using the menu bar to open dialog boxes.

! XPLMClearAllMenuItems broken (Fixed in X-Plane 7.40) Before X-Plane 7.40, this function was broken and didn't clear your menu. The workaround pre-7.40 is to call XPLMSetMenuItemName on each menu item with the empty string to clear the text manually, and then call this routine to clear the internal structures. (You must do both!) Make sure you keep track of your menu item count and call XPLMSetMenuItemName for every item, but don't run off the end of your menu.

! Text Edit Widget doesn't send xpMsg_TextFieldChanged (Still Broken) The text edit widget never sends this message. It takes a bit of a workaround to get around this. Basically you can add a widget proc to detect key presses, but you must let them go through to the text edit window and then come around later to react to the change to text contents.

! Check Box does not align properly. (Still Broken) Since the original SDK, the check box widget does not align properly when it has text in it, and must be used with a separate label widget.

! Flight Loop callbacks do not run during pause. (Fixed in X-Plane 8.10) From 7.40-7.63 and 8.00-8.06 flight loop callbacks do not run when the sim is paused. In correctly functioning versions they do run. Plugins that need continuous calls can use a display hook to get calls per frame when the sim is paused.

! XPLMDrawString may fail with custom fonts (Fixed in X-Plane 8.15) From X-Plane 7.41 (when "new-style" panels were invented) there is a risk that if you use a special font like xplmFont_PanelHUD and an old custom panel is not loaded, then a texture to draw the font with will not be present, causing corruption or an x-plane quit. This is fixed in 8.15; X-Plane will fall back to xplmFont_Basic if no old-style panel is available.

Warning: you should not be using any font other than xplmFont_Basic - see the notes on XPLMDrawString for details.

! XPLMGetDirectoryContents only returns .xpl files on Linux (Fixed in X-Plane 8.15)

XPLMGetDirectoryContents for Linux only returned .xpl files, not all files in a directory. This is fixed in 815b3.

! sim/operation/override/override_groundplane broken in XP8 (fixed in X-Plane 8.15)

The ground plane override mechanism is broken in X-Plane 8. Fixed in X-plane 8.15b3.

! XPLMLoadObject only accepts / for dir char in XP900 (fixed in XP901r1)

XPLMLoadObject requires that the directory separator for the object path be / - if you use : or \ then the sim will terminate with a fatal error.

! Writing to a shared array dataref truncates the array in XP900

If you write to a shared array dataref, the array is shortened to the highest index variable that is written.