Access violation on if statement
Hello, I am experiencing a problem in my c++ project. I added a Widget blueprint from another project, and it started crashing and giving me an "Access violation" error. I removed the widget and every reference to it, but the project is still crashing. This happens both in standalone and in selected viewport mode. The bug is reported in my "Inventory" class, which I haven't edited in a while. In the "Diagnostics.txt" file, there is no source code appearing between the [SOURCE START] and the [SOURCE END] tags. Here is a code sample which causes the probem : uint8 Number = Items.Num(); if (Index >= Number) {
This bug is strange, because the line causing the error is caused by the second "if" statement, although it is the same as the first one. I added the first "if" statement to show the strangeness of the bug. I have never seen an error like that while trying to compare two ints. However, if i replace the "Number" local variable by a literal integer (e.g I have been trying to find a solution for the past 3 hours, and the only logical explanations I could find were either corrupted memory, or a corrupted project. I also tried rebooting my pc, and rebuilding the project multiple times, to no avail.
(comments are locked)
|
After trying for a while to understand the problem, I took a backup from 4 days ago, copied all my new code and it now works. I don't know what the problem was, I'll probably at some point compare the two projects, but definitely not now.
(comments are locked)
|
Follow this question
Once you sign in you will be able to subscribe for any updates here