Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

"pointer being freed was not allocated" error on Mac #8

Open
nnahito opened this issue Apr 16, 2024 · 3 comments
Open

"pointer being freed was not allocated" error on Mac #8

nnahito opened this issue Apr 16, 2024 · 3 comments

Comments

@nnahito
Copy link

nnahito commented Apr 16, 2024

Thank you for the wonderful library.

I ran the following code on my Mac:

import uing
import strutils

var mEntry: MultilineEntry

proc extraction(_: Button) =
  echo repr(mEntry.text)

proc main = 
  let window = newWindow("Hello World!", 800, 600)

  mEntry = newMultilineEntry()

  let button = newButton("test", extraction)

  let hbox = newHorizontalBox(true)
  hbox.add(mEntry, true)
  hbox.add(button)


  window.child = hbox
  show window
  mainLoop()

init()
main()

It is a small program with Entry and buttons.
This code gets the value from Entry when the button is pressed.
At that time, the value is retrieved without any problem on Windows, but on a Mac, a memory error occurs.

malloc: *** error for object 0x10ccaa058: pointer being freed was not allocated
malloc: *** set a breakpoint in malloc_error_break to debug
SIGABRT: Abnormal termination.

Is it possible for you to correct this?
Thank you.

  • MacOS 14.1.2(23B92)
    • Apple M1 Pro
    • 16 GB
  • Nim Compiler Version 2.0.2 [MacOSX: amd64]
    • uing@0.8.0
@nnahito nnahito changed the title I get a "pointer being freed was not allocated" error on Mac "pointer being freed was not allocated" error on Mac Apr 17, 2024
@neroist
Copy link
Owner

neroist commented Apr 17, 2024

Thank you for this issue, this is odd. Do the examples at https://github.com/libui-ng/libui-ng work for you?

@nnahito
Copy link
Author

nnahito commented Apr 23, 2024

Thank you for your reply.
Sorry, what can I do with this link?
I would appreciate it if you could enlighten me!

@neroist
Copy link
Owner

neroist commented May 9, 2024

Thank you for your reply. Sorry, what can I do with this link? I would appreciate it if you could enlighten me!

@nnahito Try building and running the libui examples; instructions are in the readme

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants