At the current state, if there is a disconnection from the game towards
LibreSplit, the entire Lua state is restarted, which (currently)
re-creates the luac_functions array.
This is a memory leak (old luac_functions arrays are orphaned).
* Added asynchronous logging library
Did some rudimentary testing, might need more for safety.
Fixes#316 at least in part
* Included missing stdbool include
* Added console logging (in addition to file logging)
* Force a file flush at every write
This might be useful if we want to analyze the cause of a crash, if we
don't flush the file, one to several log lines might be missing.
* Added default log settings for release and debug versions
* Added LOG_*F formattable logging functions
* Allow the main thread to close the logger
Or LS will keep on logging from a detached thread.
* Empty the logger queue on thread exit.
This should remove the possibility of losing messages on exit.
* Add timestamps to logs and avoid double newlines
* Put the log file in XDG_DATA_DIR/libresplit
* Default LogLevel at Warns + Errors
Debug LogLevel stays at "everything"
* Bunch'o'statics
* Move prctl to the beginning of the logging thread code
* Properly free the splits icon paths on game release
This fixes a small memory leak when you load/unload/reload splits with
icons
* Correctly free stuff in the splits component too
* Fix two segfaults when timer is not loaded
A check is missing for the presence of timer, so if you right click ->
close and then try to open a split or auto splitter, libresplit
segfaults.
* Correctly free welcome_box on closing
* Make sure that malloc() in gui_settings actually works
In low-memory conditions the malloc may fail with undefined behaviour
* Revert connection of destroy signal
The widget is freed just before LibreSplit closes already. I thought it
was a disconnected signal handler.
* Autoimporter mon amour (non)
* Actually this one isn't needed anymore
In my system (and others) initializing a char* with strchr might turn up
as an error (in those cases the signature is `const char* strchr` instead of `char* strchr`).
Some sources say the signatures differ when the first argument is const,
others don't. This should fix the compilation issue at least.
* Added rough str2ida implementation
* Added small documentation.
* Move the lua pushed string to the heap
Works with compilers that don't support VLA and avoids
stack-overflow-induced headaches.
* Check if malloc actually mallocs
* Fix possible segfault if no type is defined.
The type of value to read is a mandatory argument, skipping directly to
the address (`readAddress(0x...)`) will lead to a segfault
* Fix possible segfault on calls without arguments
Just to be safe.
* Added main-window class
Seems that editing the `.window` class affects all windows in
LibreSplit, which is definitely unwanted.
Left the note in the CSS classes for posterity.
* Added another note on LibreSplit/GTK's theming capabilities
* Added a reset stylesheet as string
Theoretically, if it works as it should should fix both #272 and #63
* Applied suggestions and fixes
* Changed function signature and error handling
* Pointer Confusion
This shows the error in case of bad reset rules, tested by stepping with
GDB