U
U
ubsa2018-11-19 04:39:50
Qt
ubsa, 2018-11-19 04:39:50

Why does the program crash when trying to allocate memory with new?

https://github.com/fillows2/AOTD-Toster/tree/maste...
Crashes when clicking in the Menu >> Load Map window. Unable to allocate memory via slot MapEditorSFMLWidget::slot_LoadMap(); Through the class constructor "MapEditorSFMLWidget" *m_screen = new MapEditorScreen works fine

Answer the question

In order to leave comments, you need to log in

2 answer(s)
J
jcmvbkbc, 2018-11-19
@jcmvbkbc

Use valgrind, it will show you where you are accessing the allocated memory or using uninitialized variables.

J
Jacob E, 2018-11-19
@Zifix

Prepare and upload an archive with a minimal project on which such a problem is reproduced. The less code there is, the easier it is to find the error.

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question