Orbiter-Forum  

Go Back   Orbiter-Forum > Projects > ORBITER: 2010-P1 > Bug
Register Blogs Orbinauts List Social Groups FAQ Projects Mark Forums Read

oapiSendMFDKey crash with ExternMFD Issue Tools
issueid=976 08-10-2012 12:55 AM
Donator
oapiSendMFDKey crash with ExternMFD
oapiSendMFDKey() crashes when invoked on MFD handled by class derived from ExternMFD

Consider the following code:

#define XSIZE 400
#define YSIZE 400

MFDSPEC spec = {{0,0,XSIZE,YSIZE},6,6,YSIZE/12,YSIZE/6};

Later, in clbkPreStep() of some module:

ExternMFD *mfd = new ExternMFD(spec);
oapiSendMFDKey(mfd->Id(), OAPI_KEY_F1);

This code crashes with segmentation violation in oapiSendMFDKey.

According to documentation, ExternMFD::Id() returns object's this pointer cast to UINT. On the other hand, built-in MFDs have IDs equal to 0, 1, ... and so on. Thus, it appears that oapiSendMFDKey incorrectly dereferences MFD IDs issued by ExternMFD.
Issue Details
Project ORBITER: 2010-P1
Status Unconfirmed
Priority 5 - Medium
Affected Version 100830 (2010-P1)
Fixed Version (none)
Users able to reproduce bug 0
Users unable to reproduce bug 0
Assigned Users (none)
Tags (none)

08-10-2012 12:56 AM
Issue Changed by kamaz
  • Title changed from oapiSendKey crash with ExternMFD to oapiSendMFDKey crash with ExternMFD
  • summary changed from oapiSendKey() crashes when invoked on MFD handled by class derived from ExternMFD to oapiSendMFDKey() crashes when invoked on MFD handled by class derived from ExternMFD
Reply

Issue Tools
Subscribe to this issue

All times are GMT. The time now is 08:09 AM.

Quick Links Need Help?


About Us | Rules & Guidelines | TOS Policy | Privacy Policy

Orbiter-Forum is hosted at Orbithangar.com
Powered by vBulletin® Version 3.8.6
Copyright ©2000 - 2013, Jelsoft Enterprises Ltd.
Copyright ©2007 - 2012, Orbiter-Forum.com. All rights reserved.