I wrote an objective C plugin that loads a png file, does some filtering and unloads the file. The plugin runs fine if i compile it into an executable and run it. When i load it up in unity i can call all the functions that set parameters, but when i call the function that decodes the png file unity crashes claiming it has ran out of memory. I'm using LodePNG to decode the image. My application does no dynamic memory management other than what lodepng might do in the background. Does anyone have any ideas as to why this might be happening?