I have built a debug version and attached a debugger to PnS and the initialize function completes successfully. Since I don't have a debug build of PnS I can't really tell what's happening after that as Xcode can only display the assembly language.
A couple of clues, perhaps:
- The problem goes away if the line calling to the .resize method is removed, although that method does execute successfully in the debugger.
- The crash always happens in a routine called libsystem_platform.dylib`_platform_strlen
Any ideas anyone?
The Code
Code: Select all
/*
* RMS Level Integrator
*/
#include "./dspapi.h"
#include "./cpphelpers.h"
#include <math.h>
DSP_EXPORT uint audioInputsCount=0;
// metadata
DSP_EXPORT string name="RMS Integrator";
DSP_EXPORT string author="Centripidity";
DSP_EXPORT string description="Averages RMS level of each channel.";
// output parameters definition
DSP_EXPORT array<string> outputParametersNames={};
bool initialised = false;
DSP_EXPORT bool initialize() {
if(!initialised) {
outputParametersNames.resize(audioInputsCount);
initialised = true;
}
return true;
}