PluginX assert error: Plugin data is NULL [SOLVED]

PluginX assert error: Plugin data is NULL [SOLVED]
0.0 0


I’m using c2dx v2.2.1 and using PluginX to load Flurry. Most of the time, this works and everything’s fine. But sometimes, I guess Flurry isn’t loaded, and on the ProtocolAnalytics::logEvent() function, it throws an assert error:

assert(pData != NULL);

I’d rather have Flurry not load (and logEvent() to just do nothing) than the game crash. Is there a way to programmatically check whether or not it was loaded? I’d prefer not to make changes to ProtocolAnalytics and maintain it alongside the official coco2d-x.

~~Here’s what I’ve tried so far:

  • Check existence of pointer to ProtocolAnalytics, result: Thread 1: EXC_BAD_ACCESS (code=1, address=0xd0000008)
  • setCaptureUncaughtException(false), result: doesn’t seem to help at all~~

Turns out, my GameManager singleton wasn’t explicitly initializing my FlurryManager object, so sometimes it would be NULL and sometimes it wouldn’t, then I got those nasty side effects. Simply checking the pointer of the ProtocolAnalytics object now works as expected.