Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
是否id_rest存储在堆栈中?当回调被调用时,它可能已经超出范围,并且可能g_signal_connect不会复制它,而只是存储一个指向它的指针。
id_rest
g_signal_connect
编辑
通过重新阅读问题,我注意到您还尝试使用 malloc 从堆中分配,所以这似乎不是因为数组超出范围(除非您free在调用回调之前调用)
free