I didn’t run it (is there a patch so we can try it?) but from skimming the code quickly I’m pretty dubious that at this line
You really want std::numeric_limits::max() which is “the largest int there is” or (on your mac) 2^31 or so. What are you trying to accomplish with that comparison? Seems index will increase without bound basically (although i didn’t trace every use of it it does seem that it is mostly modded)
To be honest, this index value was needed in previous versions when looping functionality was not stateless but I reckon I can probably get rid of it now. Will have a crack at that shortly.
shouldn’t matter … the enum is simply a number, not a memory reference.
editing to add that my count shows 21 parameters being defined with configParam and 24 being instantiated with createParam though, so there’s a problem there.
A quick report to let you know that I’ve built and run your module on Linux. I haven’t got much from it yet, I just started working with it, so I’ll use github to let you know of any issues. I look forward to seeing/hearing what you come up with. Anyway, here’s what I see in Rack v1.dev:
crashing in json stuff. Those are automatic deletions normally… It’s a pain, but I would build for address sanitizer (asan). It will find a memory allocation error very quickly.
Just ran it and couldn’t make it crash. But I do notice that changing the resolution gives me junk on the screen - is it possible something is wrong there?
also in dataFromJson you don’t check if lastAntPosJ is null before you get the array element from it. Could that perhaps blow you up?
But like I said from playing for 3 minutes I couldn’t make it crash.
Thanks @Squinky . I’ll check that out. I’ve been struggling with getting debugging happening on my mac. Have attempted valgrind and gdb but no joy. (probably PEBCAK related)
I’ll try lldb ./Rack first as @jerrysv suggested (thanks Jerry) then will look into this address sanitiser stuff after that.
no, valgrind isn’t always macOS compatible (and even when you can find a build that “works”, it’s fickle, and not compatible with Catalina at all), and since you’re on a Mac, you should really be using the compiler and tools it comes with (clang/clang++/lldb) instead of gcc/g++/gdb, so don’t beat yourself up too much about those.
address/memory sanitizers work pretty well, and are a bit nicer to work with imho, but my gut tells me that your issue is going to be either configParam() or draw() like @Coirt suggested (I had missed that one on my quick glance through your code). fix those two, and chances are it will work. either way, I’d put $1 on widget related.