Unwanted colour buffer clearing

I am having a problem where the colour buffer is being cleared as if glClear(GL_COLOR_BUFFER_BIT) is called, but I cannot find such a procedure call anywhere in my code, or a call to draw a Quad over the entire screen. What is even more mysterious is that after drawing the scene a few times (a timer repaints the scene periodically), it suddenly stops clearing the colour buffer. It is causing my frame rate to crawl for a while. Has anyone else come across this?

My code is a little complicated and long to post here, but it is come to the point where I have commented out virtually the entire repainting procedure, yet it still clears the colour buffer.

If you are on Windows, then this could be because of WM_ERASEBACKGROUND message.

Otherwise, if you are using SwapBuffers, then the background buffer is considered implementation dependent.