@@ -281,7 +281,7 @@ function g_yield(data)
281281end
282282
283283sizeof_gclosure = 0
284- function __init__ ()
284+ function __init__gtype__ ()
285285 ccall ((:g_type_init ,libgobject),Void,())
286286 global jlref_quark = quark " julia_ref"
287287 global sizeof_gclosure = WORD_SIZE
@@ -291,12 +291,9 @@ function __init__()
291291 closure = ccall ((:g_closure_new_simple ,libgobject),Ptr{Void},(Int,Ptr{Void}),sizeof_gclosure,C_NULL )
292292 end
293293 ccall ((:g_closure_sink ,libgobject),Void,(Ptr{Void},),closure)
294+ end
294295
295- global JuliaClosureMarshal = cfunction (GClosureMarshal, Void,
296- (Ptr{Void}, Ptr{GValue}, Cuint, Ptr{GValue}, Ptr{Void}, Ptr{Void}))
297- global exiting = false
298- atexit (()-> global exiting = true )
299-
296+ function __init__gmainloop__ ()
300297 global uv_sourcefuncs = _GSourceFuncs (
301298 cfunction (uv_prepare,Cint,(Ptr{Void},Ptr{Cint})),
302299 cfunction (uv_check,Cint,(Ptr{Void},)),
@@ -318,3 +315,14 @@ function __init__()
318315 ccall ((:g_source_unref ,GLib. libglib),Void,(Ptr{Void},),src)
319316end
320317
318+ function __init__ ()
319+ if isdefined (GLib,:__init__bindeps__ )
320+ GLib. __init__bindeps__ ()
321+ end
322+ global JuliaClosureMarshal = cfunction (GClosureMarshal, Void,
323+ (Ptr{Void}, Ptr{GValue}, Cuint, Ptr{GValue}, Ptr{Void}, Ptr{Void}))
324+ global exiting = false
325+ atexit (()-> global exiting = true )
326+ __init__gtype__ ()
327+ __init__gmainloop__ ()
328+ end
0 commit comments