Hi, is the problem solved or not ?
Anyhow, lets try to clear things up. malloc works also in C++, but it has to be used correctly. You must not use malloc for allocating the C++ classes (objects). Those have to be allocated through 'new' operator, which also calls class constructors. Then they have to be freed through 'delete' call which will call its destructor. If you would have defined some class A, and then you would allocate it through malloc like A* pA = malloc( sizeof( A ) ); it could cause some headaches. I'm not sure what problems does it cause, but it does. It should be alloced like A* pA = new A;
about the fread() call - I can't answer properly when I don't know what are the parameter types, and how are they used. Can you post some code before the fread() call ?
Also, in case that 'Polygons' variable is a array of classes, this could be causing the problems. Classes can have some hidden variables so its not good to overwrite them as a whole, for example if you have class A; A a; fread( &a, sizeof( a ), 1, file ); or memset( &a, 0, sizeof( a ) ); could cause overwriting its internal variables.