954,504 Members — Technology Publication meets Social Media
Username:
Password:
Lost login information?
Have something to say? Contribute New Article Reply to this Article

Passing constant reference Heap error

Hi there everyone,

I really hope someone can help me, I am working with Visual C++ with QT libraries and using... well... something that represents MVC (long story)... now I need to pass a const QString& from my 1 controller class to the model of another class...

When doing so I get an access violation app crash... I have checked the variable to be passed just before the function call and also entered a message to be displayed first thing in the function being called... the value is available and displays 100%, but before the next debug message shows the app crashes... Anyone with any advice as to why this could happen or how to fix it?


Sending:

if(NoFaultFound){

		qDebug() << "Executes" << endl;
		system("pause");

		for(int k = 0; k < ResourceNumbersToUpdateList.count(); k++){

			qDebug() << "Value check: " << ResourceNumbersToUpdateList.at(k) << endl;
			system("pause");

			ResourceTWObject->DataObject->updateOperation(ResourceNumbersToUpdateList.at(k));

			qDebug() << "Does not reach" << endl;
			system("pause");
		}
	}

Receiving:

void ResourceContainerCLS::updateOperation(const QString& ResourceCode){

	qDebug() << "does not execute" << endl;
	system("pause");
Eagletalon
Junior Poster
113 posts since Mar 2011
Reputation Points: 47
Solved Threads: 13
 

This question has already been solved

Post: Markdown Syntax: Formatting Help
You
View similar articles that have also been tagged: