SOLVED!
crash around ACAPI_3D_GetCurrentWindowSight
Anonymous
Not applicable
Options
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎2020-09-07
09:19 AM
- last edited on
‎2021-09-14
01:48 PM
by
Noemi Balogh
‎2020-09-07
09:19 AM
Hi, guys.
There is something strange occurs in my add-on. I am quite sure the crash happens around ACAPI_3D_GetCurrentWindowSight when it is called for its 3rd time.
I was wondering if the destructor of Modeler::SightPtr itself releases the space created before so I have to create Modeler::SightPtr on the heap rather than stack?
Here is my code:
There is something strange occurs in my add-on. I am quite sure the crash happens around ACAPI_3D_GetCurrentWindowSight when it is called for its 3rd time.
I was wondering if the destructor of Modeler::SightPtr itself releases the space created before so I have to create Modeler::SightPtr on the heap rather than stack?
Here is my code:
AttributeReader attrReader; ModelerAPI::Model model; Modeler::SightPtr currentSightPtr; GSErrCode sightErr = ACAPI_3D_GetCurrentWindowSight((void**)¤tSightPtr); if (sightErr != NoError) { return APIERR_CANCEL; } EXPGetModel(currentSightPtr, &model, &attrReader);Could anyone help me please? Thanks in advance.
Solved! Go to Solution.
Labels:
- Labels:
-
Add-On (C++)
1 ACCEPTED SOLUTION
Accepted Solutions
Solution
Anonymous
Not applicable
Options
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎2020-09-07 09:43 AM
‎2020-09-07
09:43 AM
Maybe I have solved the problem.
Here is my new code:
Here is my new code:
AttributeReader attrReader; ModelerAPI::Model model; Modeler::Sight* sight = nullptr; //Modeler::SightPtr currentSightPtr(sight); //GSErrCode sightErr = ACAPI_3D_GetCurrentWindowSight((void**)¤tSightPtr); GSErrCode sightErr = ACAPI_3D_GetCurrentWindowSight((void**)&sight); if (sightErr != NoError) { return APIERR_CANCEL; } Modeler::SightPtr currentSightPtr(sight); EXPGetModel(currentSightPtr, &model, &attrReader);I am testing it.
1 REPLY 1
Solution
Anonymous
Not applicable
Options
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎2020-09-07 09:43 AM
‎2020-09-07
09:43 AM
Maybe I have solved the problem.
Here is my new code:
Here is my new code:
AttributeReader attrReader; ModelerAPI::Model model; Modeler::Sight* sight = nullptr; //Modeler::SightPtr currentSightPtr(sight); //GSErrCode sightErr = ACAPI_3D_GetCurrentWindowSight((void**)¤tSightPtr); GSErrCode sightErr = ACAPI_3D_GetCurrentWindowSight((void**)&sight); if (sightErr != NoError) { return APIERR_CANCEL; } Modeler::SightPtr currentSightPtr(sight); EXPGetModel(currentSightPtr, &model, &attrReader);I am testing it.