more malloc improvements

still same problem on attaching objects to scene a second time.
or
detaching objects from scene!!