After connecting and disconnecting for x times the
server exits without notice.
Restarting it is however possible.
I haven't had time to investigate this further yet.
try changing the DeleteObject order in RectangleSend( LPVOID parent ):
DeleteObject(hBMP);
DeleteObject(hBMPCmpCopy);
DeleteDC(hDCCopy);
DeleteDC(hDCCmpCopy);
//DC must be deleted before DIB otherwise DIB remains in memory
DeleteObject(hDIBCmp);
DeleteObject(hDIB);
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
this is probably due to the memory consumption..
try changing the DeleteObject order in RectangleSend( LPVOID parent ):
DeleteObject(hBMP);
DeleteObject(hBMPCmpCopy);
DeleteDC(hDCCopy);
DeleteDC(hDCCmpCopy);
//DC must be deleted before DIB otherwise DIB remains in memory
DeleteObject(hDIBCmp);
DeleteObject(hDIB);