Comments (3)
Looks like that was indeed the issue. Worth noting that to get it working, I had to manually clone the latest version - updating the quicklisp and uptralisp dists did not fix the issue on its own. From this I conclude it is likely that the version of cl-gobject-introspection
on quicklisp is outdated.
Happy to close the issue if you want.
from cl-gtk4.
I've done some more investigation, and it seems that similar errors can occur even if the object created is not used in anything. I'm unsure if this is related or a separate issue, so I'm adding it in the comments here instead of editing the original issue.
Below is a modified version of the start function which creates a shortcut that is then unused (and hence can be gc'd).
(defun start (app)
(let ((window (gtk4:make-application-window :application app))
(unused-shortcut
(gtk4:make-shortcut
:trigger (gtk4:shortcut-trigger-parse-string :string "<Ctrl>C")
:action (gtk4:shortcut-action-parse-string :string "action(window.do_stuff)"))))
(format t "shortcut: ~A~%" unused-shortcut)
(setf (gtk4:window-title window) "Test")
(setf *window* window)
(unless (gtk4:widget-visible-p window)
(gtk4:window-present window))))
Running the script with this modification with this modification resulted in the following output:
shortcut: #<OBJECT-INSTANCE {1004746613}>
CORRUPTION WARNING in SBCL pid 23868 tid 23869:
Memory fault at 0x100000001 (pc=0x7f47e15fcf61, fp=0x55979c866ba8, sp=0x7f47e184e768) tid 23869
The integrity of this image is possibly compromised.
Continuing with fingers crossed.
WARNING:
Error calling finalizer #<FUNCTION (LAMBDA ()
:IN
GIR::OBJECT-SETUP-GC) {10047B092B}>:
#<SB-SYS:MEMORY-FAULT-ERROR {10013B8273}>
from cl-gtk4.
I'm sorry I'm unable to reproduce the issue you mentioned, but based on my experience, the documentation for the Widget.add_controller
parameter in GTK4 is as follows:
The instance takes ownership of the data, and is responsible for freeing it.
I suspect that you may be using an older version of cl-gobject-introspection that does not handle object ownership correctly, which can result in some memory issues. Could you please update all the libraries to their latest versions and try again?
from cl-gtk4.
Related Issues (20)
- Could you make the library interface more declarative? HOT 11
- DSL for Cairo library. HOT 1
- Can't install CL-GTK.WEBKIT HOT 1
- Returning from dialogs HOT 1
- Error Building via Github Actions HOT 4
- Can't load the library HOT 1
- What about Cairo in Lisp? HOT 3
- Can't make a GStream binding. HOT 1
- Typelib file for namespace 'Gtk', version '4.0' not found HOT 4
- How to make a GListStore of fixnums / How to subclass GObject HOT 2
- Library needs more documentation HOT 1
- Can't create simple application. HOT 4
- FLOATING-POINT-INVALID-OPERATION HOT 5
- arithmetic error DIVISION-BY-ZERO signalled HOT 2
- Cant create wigets to store it in variable HOT 1
- When vertically scaling the window, there is an artifact with the buttons. HOT 1
- No symbol named "POINTER-OBJECT" HOT 2
- Error g_error_free on Windows 11 HOT 6
- Can't properly pass "user_data" to callback for open file dialog HOT 2
- Support for Subclassing? HOT 1
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from cl-gtk4.