In visual studio you can enable some memory analysis features (causes your code to become slower). It could be that the memory analysis is automagically enabled to some extent when building an MFC application.