Ticket #1157 (closed defect: invalid)

Opened 6 years ago

Last modified 6 years ago

afterSizeAllocate throws schedule: re-entered unsafely bug

Reported by: guest Owned by: axel
Priority: normal Milestone: 0.10.2
Component: general (Gtk+, Glib) Version: 0.9.13
Keywords: Cc: lonetiger@…

Description

After trying the mailing list and not getting any response I though I'd just report it as a bug.

The error thrown is : Client.exe: schedule: re-entered unsafely.

Perhaps a 'foreign import unsafe' should be 'safe'?

and a sample code is

-- | Event in which we need to resize the images in. frameResizeEvent :: [Image] -> Pos -> Rectangle -> IO () frameResizeEvent imgs (h,w) (Rectangle x y width height) =

do

print (x,y,width,height)

let f = (fromIntegral)
Int -> Float
let t = (truncate)
Float -> Int let wScale = ceiling (f width/ f w) let hScale = ceiling (f height/ f h) mapM_ (scalePixbufTo wScale hScale) imgs

scalePixbufTo :: Int -> Int -> Image -> IO () scalePixbufTo w h img =

do

buf <- imageGetPixbuf img nBuf <- pixbufScaleSimple buf w h InterpBilinear? imageSetFromPixbuf img nBuf

It works one time, when the window is initially shown, but after that, it crashes with the error mentioned above. This really is a show stopper for me and I hope it's just me doing something wrong.

Change History

Changed 6 years ago by guest

Better formatted code

-- | Event in which we need to resize the images in.
frameResizeEvent :: [Image] -> Pos -> Rectangle -> IO ()
frameResizeEvent imgs (h,w) (Rectangle x y width height) = 
 do
   print (x,y,width,height)
   let f = (fromIntegral) :: Int -> Float
   let t = (truncate) :: Float -> Int
   let wScale = ceiling (f width/ f w)
   let hScale = ceiling (f height/ f h)
   mapM_ (scalePixbufTo wScale hScale) imgs
   
scalePixbufTo :: Int -> Int -> Image -> IO ()
scalePixbufTo w h img = 
 do
    buf <- imageGetPixbuf img
    nBuf <- pixbufScaleSimple buf w h InterpBilinear
    imageSetFromPixbuf img nBuf

Changed 6 years ago by pgavin

  • owner changed from somebody to axel

Changed 6 years ago by pgavin

  • milestone changed from 1.0 to 0.10.2

Changed 6 years ago by axel

  • status changed from new to closed
  • resolution set to invalid

This is due to an infinite recursion as discussed on the mailing list.

Note: See TracTickets for help on using tickets.