the prblem is the delete m_paintdevice in cleanuptestcase. you'd have noticed if you had set the pointer to 0 after thw delete. use the sharedpointer variant instaed, alsomdon't make m_clor a pointer. boud