SDP: reverting temporary mem contexts