Giter Club home page Giter Club logo

Comments (3)

rationalis-petra avatar rationalis-petra commented on August 20, 2024 1

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.

rationalis-petra avatar rationalis-petra commented on August 20, 2024

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.

bohonghuang avatar bohonghuang commented on August 20, 2024

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)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo 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.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.