Highlighted

IllustratorSDK HelloWorld.aip crash Mac OS EXC_BAD_ACCESS

New Here ,
Nov 06, 2020

Copy link to clipboard

Copied

Hello,

 

I'm following the Illustrator getting started guide tutorial to create a Hello World plugin. I can successfully build the plugin, but Illustrator crashes. Xcode is telling me that I'm getting an EXC_BAD_ACCESS error. Looking at the code the problem is here in HelloWorld.cpp:

 

 

if (sSPBasic->IsEqual(caller, kSPInterfaceCaller)) {

        AIUserSuite *sAIUser = NULL;

        error = sSPBasic->AcquireSuite(kAIUserSuite, kAIUserSuiteVersion, (const

                                                                           void**) &sAIUser);

        error = sSPBasic->AcquireSuite(kAIUnicodeStringSuite,

                                       kAIUnicodeStringSuiteVersion, (const void**) &sAIUnicodeString);

        error = sSPBasic->AcquireSuite(kSPBlocksSuite, kSPBlocksSuiteVersion, (const

                                                                               void**) &sSPBlocks);

        if(sSPBasic->IsEqual(selector, kSPInterfaceStartupSelector)){

            sAIUser->MessageAlert(ai::UnicodeString("Hello World!"));

        }

 

here sAiUser is initialized with NULL. I assume that sSPBasic::AquireSuite is supposed to initialize sAiUser but it is never initialized and remains NULL, which I believe is leading to a null pointer exception when calling sAIUser::MessageAlert. Does anyone have any idea how to fix this?

TOPICS
Bug, SDK

Views

17

Likes

Translate

Translate

Report

Report
Community Guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more

IllustratorSDK HelloWorld.aip crash Mac OS EXC_BAD_ACCESS

New Here ,
Nov 06, 2020

Copy link to clipboard

Copied

Hello,

 

I'm following the Illustrator getting started guide tutorial to create a Hello World plugin. I can successfully build the plugin, but Illustrator crashes. Xcode is telling me that I'm getting an EXC_BAD_ACCESS error. Looking at the code the problem is here in HelloWorld.cpp:

 

 

if (sSPBasic->IsEqual(caller, kSPInterfaceCaller)) {

        AIUserSuite *sAIUser = NULL;

        error = sSPBasic->AcquireSuite(kAIUserSuite, kAIUserSuiteVersion, (const

                                                                           void**) &sAIUser);

        error = sSPBasic->AcquireSuite(kAIUnicodeStringSuite,

                                       kAIUnicodeStringSuiteVersion, (const void**) &sAIUnicodeString);

        error = sSPBasic->AcquireSuite(kSPBlocksSuite, kSPBlocksSuiteVersion, (const

                                                                               void**) &sSPBlocks);

        if(sSPBasic->IsEqual(selector, kSPInterfaceStartupSelector)){

            sAIUser->MessageAlert(ai::UnicodeString("Hello World!"));

        }

 

here sAiUser is initialized with NULL. I assume that sSPBasic::AquireSuite is supposed to initialize sAiUser but it is never initialized and remains NULL, which I believe is leading to a null pointer exception when calling sAIUser::MessageAlert. Does anyone have any idea how to fix this?

TOPICS
Bug, SDK

Views

18

Likes

Translate

Translate

Report

Report
Community Guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
Nov 06, 2020 0

Have something to add?

Join the conversation
Resources