You must either delete the wxMemoryDC (with delete_instance) or call select_object( wxNullBitmap ) before selecting the bitmap into another wxMemoryDC.
Selects a bitmap into the wxMemoryDC. If obj is wxNullBitmap, then the bitmap currently selected into the DC is deselected.