* Add guard in maps.c to avoid NULL-dereferencing
* Remove dead-store in bind.c
It's assigned in the for loop anyway and never read outside of it.
* Remove dead-store in theming.c
We assign the error flag and then never read from it again.
* Remove dead-store in prev-segment.c
It's assigned in the if statement 3 lines below, and never read outside
of it.
* Move GSList declaration inside for loop
* Address GCC's complaints about missing va_end()s
* Address possible failure in callocating error_msg
* Make sure dialogs at least try to find a parent window
Given when they're viewed, the only active window should be the main
window from LibreSplit. If push comes to shove, we can change the code
to iterate through all windows until we find one that is "marked" as the
main window.
Fixes#261
* Autoimporter stuff
* 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
* Fix segfault on first start
If no split_file is defined, there will be a NULL-point dereference,
leading to a segfault. This fixes that.
* First idea of "delayed keybind handlers"
* Trying to make the structure more reusable
Not sure it worked.
* Added missing pragma
* Fill out descriptions of themes.md
Some are self explanitory, but I got confused by a lot while making a theme so I thought I'd try and add something to everything.
* Update themes.md
From review from penaz
* Disallow changing splits or autosplitter if a run is on
Fixes#241
* Define external function to see if a run is started
Uses the RTA timer "running" property and the atomic_bool run_started
from the Auto splitter
* Replace or statement with relative descriptive function
* Use is_run_started for autosplitter warnings too
* Create confirm reset dialog
* Add detection logic for a gold in the current run
* Prompt for confirmation when run has a gold split
* Switch to using stdbool
* Move reset logic to not interfere with other logic