Update of /cvsroot/netrek/client/netrekxp/src
In directory sc8-pr-cvs7.sourceforge.net:/tmp/cvs-serv7060/src

Modified Files:
	mswindow.c 
Log Message:
Using DeleteDC instead of ReleaseDC on map SDB buffer, apparently
this is the correct way to release a DC made by CreateCompatibleDC.
Added some extra precautions during creating the SDB DCs, apparently
one needs to worry about the objects stored into a DC when it is created.
So following what is done for the other global DCs, the object is selected
and removed.  The reason for these changes is to try and stop a hard to
reproduce bug where certain bitmap graphics are not displaying correct,
most noticeable on the new planet and team window bitmaps.  Since it's
not a pointer problem (these are only stored not pointed to), and it's not
a memory allocation error (that would crash the program), and since the
graphics that display during the error state look oddly like Windows buttons
or icons,I believe it's some sort of default bitmap/whatever not being freed.
Only time will tell if these changes actually fix the problem.
Also cleaned up todo list.

Index: mswindow.c
===================================================================
RCS file: /cvsroot/netrek/client/netrekxp/src/mswindow.c,v
retrieving revision 1.49
retrieving revision 1.50
diff -u -d -r1.49 -r1.50
--- mswindow.c	19 Mar 2007 02:20:26 -0000	1.49
+++ mswindow.c	19 Mar 2007 09:25:17 -0000	1.50
@@ -644,7 +644,7 @@
 
     SelectObject (mapSDB->mem_dc, mapSDB->old_bmp);
     DeleteObject (mapSDB->mem_bmp);
-    ReleaseDC (((Window *)mapSDB->window)->hwnd, mapSDB->win_dc);
+    DeleteDC (mapSDB->win_dc);
     free (mapSDB);
 
     //WinKey Kill Library Stop
@@ -5611,6 +5611,7 @@
 {
     Window * win;
     SDBUFFER * sdb;
+    HBITMAP junk;
 
     win = ((Window *)window);
 
@@ -5636,6 +5637,14 @@
     if (sdb->mem_dc == NULL)
         return NULL;
 
+    //This code ripped from W_Initialize, better safe than sorry
+    junk = CreateBitmap (1, 1, 1, 1, NULL);
+    GlobalOldMemDCBitmap = (HBITMAP) SelectObject (sdb->win_dc, junk);
+    SelectObject (sdb->win_dc, GlobalOldMemDCBitmap);
+    GlobalOldMemDC2Bitmap = (HBITMAP) SelectObject (sdb->mem_dc, junk);
+    SelectObject (sdb->mem_dc, GlobalOldMemDC2Bitmap);
+    DeleteObject (junk);
+    
     sdb->mem_bmp = CreateCompatibleBitmap (sdb->win_dc, sdb->wr.right, sdb->wr.bottom);
     if (sdb->mem_bmp == NULL)
         return NULL;