prevent death by zombie
authorGood Guy <good1.2guy@gmail.com>
Mon, 16 May 2016 18:18:53 +0000 (12:18 -0600)
committerGood Guy <good1.2guy@gmail.com>
Mon, 16 May 2016 18:18:53 +0000 (12:18 -0600)
cinelerra-5.1/guicast/bcbitmap.h
cinelerra-5.1/guicast/test4.C
cinelerra-5.1/guicast/vframe.C

index 1d89a44d5b375afa8715832efa57e8e50acd24af..88d777b340536959e490da01162d35ea12c3d607 100644 (file)
@@ -261,6 +261,7 @@ public:
        int is_xwindow() { return type==bmXShmImage || type==bmXImage; }
        int is_shared() { return type==bmXvShmImage || type==bmXShmImage; }
        int is_unshared() { return type==bmXvImage  || type==bmXImage; }
+       int is_zombie() { return cur_bfr()->is_zombie(); }
 
        int set_bg_color(int color);
        int invert();
index 6e9d27f72261b62ce374af58dd43e8434dcad708..0c2c2fdd1e9b3885ae54d8ebf8a2464879459c6d 100644 (file)
@@ -1,5 +1,5 @@
 
-//c++ -g -I../guicast testwindow.C ../guicast/x86_64/libguicast.a \
+//c++ -g -I../guicast test4.C ../guicast/x86_64/libguicast.a \
 // -DHAVE_GL -DHAVE_XFT -I/usr/include/freetype2 -lGL -lX11 -lXext \
 // -lXinerama -lXv -lpng  -lfontconfig -lfreetype -lXft -pthread
 
@@ -119,7 +119,7 @@ int main(int ac, char **av)
        struct stat st;  fstat(fd,&st);
        unsigned char *dat = new unsigned char[st.st_size];
        read(fd, dat, st.st_size);
-       VFrame ifrm(dat, st.st_size);
+       VFramePng ifrm(dat, st.st_size);
        delete [] dat;
        close(fd);
        int w = ifrm.get_w(), h = ifrm.get_h();
@@ -141,9 +141,9 @@ int main(int ac, char **av)
                        cfrm.transfer_from(&bfrm, 0);
                        printf("xfer_%s_to_%s\n",cmdl[fr_cmdl],cmdl[to_cmdl]);
                        test_window.show_text(50,50, "xfer_%s_to_%s",cmdl[fr_cmdl],cmdl[to_cmdl]);
-                       write_pgm(cfrm.get_data(), w,h, "/tmp/test/xfer_%s_to_%s.pgm",
-                               cmdl[fr_cmdl],cmdl[to_cmdl]);
-                       //usleep(100000);
+//                     write_ppm(cfrm.get_data(), w,h, "/tmp/test/xfer_%s_to_%s.pgm",
+//                             cmdl[fr_cmdl],cmdl[to_cmdl]);
+//                     usleep(100000);
                }
        }
        test_window.close_window();
index 36418704aa8d277c2a2bb4751a529b9c4e1178f9..e5d3759724ab1d8c460bd65b1f4806861c17c9cf 100644 (file)
@@ -536,7 +536,7 @@ void VFrame::set_memory(BC_Bitmap *bitmap)
 {
        int shmid = 0;
        unsigned char *data = 0;
-       if( bitmap->is_shared() )
+       if( bitmap->is_shared() && !bitmap->is_zombie() )
                shmid = bitmap->get_shmid();
        else
                data = bitmap->get_data();