Your if condition is accessing uninitialized memory.
Your memcpy does not check if buffer is 3*sizeof(double) long before accessing it.
Your prev_a is a local variable, it is only valid to the end of the scope of your readyRead() function.
If you want it to be persistent over multiple calls, you need to have it as a member of the class.
Cheers,
_
Bookmarks