Im sorry it has taken me so long to reply. I had been out of town this week.
I had tried to use the mraa_spi_stop() function directly with the same error result. In the mraa documentation the destructor ~Spi() calls the mraa_spi_stop() function, so it isnt any surprise. Both do stop the spi bus, however it throws the error and aborts which is strange.
I'm using the arduino board with pins 13, 11, 10 configured for SPI via the linux commands. The board is connected to a MAX7219 LED dispaly driver via the SPI pins. (exluding pin12 MISO).
This is the class which calls the functions (Note: OO method is commented out as I have tried both methods):
MAX7219Driver::s = new mraa::Spi(1);
MAX7219Driver::s = mraa_spi_init(1);
The main() processes data it receives from a hall sensor and, then writes data to the MAX7219, which all works the way it should. The problem occurs when a button is pressed which calls a function to send shut down command to the MAX7219 and, then exit the main() while(1) loop and call the SPI shutdown function, then exit program.
The program outputs the aforemetioned error and exits.