ViewVC Help
View File | Revision Log | Show Annotations | Revision Graph | Root Listing
root/cebix/BasiliskII/src/Unix/video_x.cpp
(Generate patch)

Comparing BasiliskII/src/Unix/video_x.cpp (file contents):
Revision 1.54 by cebix, 2001-07-06T22:00:39Z vs.
Revision 1.55 by cebix, 2001-07-06T22:37:23Z

# Line 67 | Line 67 | using std::sort;
67   #include "user_strings.h"
68   #include "video.h"
69  
70 < #define DEBUG 1
70 > #define DEBUG 0
71   #include "debug.h"
72  
73  
# Line 340 | Line 340 | static void set_mac_frame_buffer(video_d
340          InitFrameBufferMapping();
341   #else
342          VideoMonitor.mac_frame_base = Host2MacAddr(the_buffer);
343        D(bug("Host frame buffer = %p, ", the_buffer));
343   #endif
344          D(bug("VideoMonitor.mac_frame_base = %08x\n", VideoMonitor.mac_frame_base));
345   }
# Line 506 | Line 505 | driver_base::~driver_base()
505          }
506   #ifdef ENABLE_VOSF
507          else {
508 +                if (the_host_buffer) {
509 +                        free(the_host_buffer);
510 +                        the_host_buffer = NULL;
511 +                }
512                  if (the_buffer != (uint8 *)VM_MAP_FAILED) {
513                          vm_release(the_buffer, the_buffer_size);
514                          the_buffer = NULL;
# Line 605 | Line 608 | driver_window::driver_window(const video
608                  if (shm_error) {
609                          shmdt(shminfo.shmaddr);
610                          XDestroyImage(img);
611 +                        img = NULL;
612                          shminfo.shmid = -1;
613                  } else {
614                          have_shm = true;
# Line 630 | Line 634 | driver_window::driver_window(const video
634          the_buffer_size = page_extend((aligned_height + 2) * img->bytes_per_line);
635          the_buffer_copy = (uint8 *)vm_acquire(the_buffer_size);
636          the_buffer = (uint8 *)vm_acquire(the_buffer_size);
637 +        D(bug("the_buffer = %p, the_buffer_copy = %p, the_host_buffer = %p\n", the_buffer, the_buffer_copy, the_host_buffer));
638   #else
639          // Allocate memory for frame buffer
640          the_buffer = (uint8 *)malloc((aligned_height + 2) * img->bytes_per_line);
641 +        D(bug("the_buffer = %p, the_buffer_copy = %p\n", the_buffer, the_buffer_copy));
642   #endif
643  
644          // Create GC
# Line 668 | Line 674 | driver_window::driver_window(const video
674   // Close display
675   driver_window::~driver_window()
676   {
671        if (img)
672                XDestroyImage(img);
677          if (have_shm) {
678                  XShmDetach(x_display, &shminfo);
679 + #ifdef ENABLE_VOSF
680 +                the_host_buffer = NULL; // don't free() in driver_base dtor
681 + #else
682                  the_buffer_copy = NULL; // don't free() in driver_base dtor
683 + #endif
684 +        }
685 +        if (img)
686 +                XDestroyImage(img);
687 +        if (have_shm) {
688 +                shmdt(shminfo.shmaddr);
689 +                shmctl(shminfo.shmid, IPC_RMID, 0);
690          }
691          if (gc)
692                  XFreeGC(x_display, gc);

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines