Comment 4 for bug 1582496

Revision history for this message
Dave Burke (1dbup) wrote :

I don't know if the following will help in tracking this down but I'm developing code in openCV and sometimes see this. It happens after creating a 'namedwindow()'. If the new window isn't loaded with an image, it seems to time out and give the error. I was investigating some timing issues in my code and decided to put a waitkey() delay to allow window generation to finish before doing the timing checks and I started getting the "G_IS_OBJECT (object)" failure. I got rid of it by inserting an imshow() for each new window and the problem disappears.

The following snippet may help, if the three lines after the comment are removed then the report occurs three times

  namedWindow("Input-Gray", WINDOW_NORMAL);
  createTrackbar("StdDevVal", "Input-Gray",&SDPosn,255, SDTBEvent);
  createTrackbar("MeanVal", "Input-Gray",&MeanPosn,255, MeanEvent);
  createTrackbar("Deriv", "Input-Gray",&DerivPosn,255, DerivEvent);
  namedWindow("SDMasked", WINDOW_NORMAL);
  namedWindow("MeanMasked", WINDOW_NORMAL);
  namedWindow("DerivMasked", WINDOW_NORMAL);
  imshow("Input-Gray", M_gray);

  // the following stops the reporting of :-
  //(Input:4135): GLib-GObject-CRITICAL **: g_object_unref:assertion 'G_IS_OBJECT (object)' failed

  // seems to be associated with creating a window and not showing an image!

  imshow("SDMasked", M_gray);
  imshow("MeanMasked", M_gray);
  imshow("DerivMasked", M_gray);

  if( cv::waitKey(0) != 0x20 ) // wait for windows to settle
.....