in paint.c we have the function: void copy_paint(Paint *src, Paint *tar) { tar->brush= src->brush; } shouldn't that be this? void copy_paint(Paint *src, Paint *tar) { tar->brush= src->brush; id_us_plus((ID*)(src->brush)); }