Closed hugopl closed 4 years ago
The compilation was fixed, but crashes.
Code to crash (Need to go on another terminal and touch/create some file)
require "gobject/gtk/autorun"
def file_changed(monitor : Gio::FileMonitor, file : Gio::File, other_file : Gio::File, event : Gio::FileMonitorEvent)
end
monitor = Gio::File.new_for_path(".").monitor_directory(:watch_moves, nil)
monitor.on_changed(&->file_changed(Gio::FileMonitor, Gio::File, Gio::File, Gio::FileMonitorEvent))
# just the check to see if gtk side is ok
#monitor.connect("changed") do
# puts "hey"
#end
Crash
Invalid memory access (signal 11) at address 0x0
[0x55f00e6f4a06] *CallStack::print_backtrace:Int32 +118
[0x55f00e6e738e] __crystal_sigfault_handler +286
[0x7fd02349f960] ???
[0x55f00e74b6d4] *Gio::File::Wrapper +4
[0x55f00e74b6c6] *Gio::File::Wrapper +6
[0x55f00e74b693] *Gio::File::Wrapper#initialize<Pointer(LibGio::File)>:Nil +67
[0x55f00e74b638] *Gio::File::Wrapper::new<Pointer(LibGio::File)>:Gio::File::Wrapper +104
[0x55f00e6e7589] ~procProc(Pointer(LibGio::File), Pointer(LibGio::File), UInt32, Pointer(LibGio::FileMonitor), Nil) +73
[0x7fd0238c4295] ???
[0x7fd02383080a] g_signal_emit_valist +4730
[0x7fd023830980] g_signal_emit +144
[0x7fd023981565] ???
[0x7fd02372a43c] g_main_context_dispatch +604
[0x7fd023777fa9] ???
[0x7fd023728c03] g_main_loop_run +131
[0x7fd023c94c0f] gtk_main +127
[0x55f00e6e7416] main +86
[0x7fd023269002] __libc_start_main +242
[0x55f00e6d158e] _start +46
[0x0] ???
The following code fails to compile:
Error:
GFileMonitorEvent
is a enum in C.