FLTK logo

Re: [fltk.general] Re: Window is frozen

FLTK matrix user chat room
(using Element browser app)   FLTK gitter user chat room   GitHub FLTK Project   FLTK News RSS Feed  
  FLTK Apps      FLTK Library      Forums      Links     Login 
 All Forums  |  Back to fltk.general  ]
 
Previous Message ]New Message | Reply ]Next Message ]

Re: Re: Window is frozen Manolo Nov 29, 2021  
 

Le lundi 29 novembre 2021 à 09:47:09 UTC+1, sups...@gmail.com a écrit :

void output(std::string s)
{
std::cout << const_cast<char*>(("@S14@C92@." + s).c_str()) << std::endl;
Fl::awake(awake, const_cast<char*>(("@S14@C92@." + s).c_str()));
}

 I believe the error is in that function, output(), in the call to Fl::awake().
The memory storage of the 2nd argument sent to Fl::awake is unstable, it can be reused at any time
after return from the Fl::awake() function.

Change that 2nd argument to a form where you control the lifetime of this char array, and make sure it's not
changed until it's been used by the main thread.

--
You received this message because you are subscribed to the Google Groups "fltk.general" group.
To unsubscribe from this group and stop receiving emails from it, send an email to fltkgeneral+unsubscribe@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/fltkgeneral/a7d43e8b-c596-41d2-9978-82d54f2265bcn%40googlegroups.com.
Direct Link to Message ]
 
     
Previous Message ]New Message | Reply ]Next Message ]
 
 

Comments are owned by the poster. All other content is copyright 1998-2024 by Bill Spitzak and others. This project is hosted by The FLTK Team. Please report site problems to 'erco@seriss.com'.