1
General / Re: sf::Text application crash
« on: June 18, 2020, 08:55:56 pm »
Many thanks!
The specification is very clear, indeed.
I tought that the text object would store a copy of the font, that seemed intuitive to me, for the convenience of not having to manage a separate object, and it would prevent the application crash, that in VS debugs into a misterious "Access violation reading location".
Exception thrown at 0x00007FF6020939E3 in Example.exe: 0xC0000005: Access violation reading location 0x0000000000000008.
In general, I worry about these "Access violation" problems, wondering if they could be a security concern (exploitable). Of course, they depend on a bug in the code, as always... in my case, to let the font object get out of scope. But the point is if that bug is a fairly common mistake, then we have a risk.
Anyway, I understand that was a design choice, and I'm sure for good reasons (memory... if one font and many texts; perhaps performance also for the copy).
The specification is very clear, indeed.
I tought that the text object would store a copy of the font, that seemed intuitive to me, for the convenience of not having to manage a separate object, and it would prevent the application crash, that in VS debugs into a misterious "Access violation reading location".
Exception thrown at 0x00007FF6020939E3 in Example.exe: 0xC0000005: Access violation reading location 0x0000000000000008.
In general, I worry about these "Access violation" problems, wondering if they could be a security concern (exploitable). Of course, they depend on a bug in the code, as always... in my case, to let the font object get out of scope. But the point is if that bug is a fairly common mistake, then we have a risk.
Anyway, I understand that was a design choice, and I'm sure for good reasons (memory... if one font and many texts; perhaps performance also for the copy).