Overview
Examples
Screenshots
Comparisons
Applications
Download
Documentation
Tutorials
Bazaar
Status & Roadmap
FAQ
Authors & License
Forums
Funding Ultimate++
Search on this site
Search in forums












SourceForge.net Logo
Home » Community » Newbie corner » VectorMap Find function crash [SOLVED]
VectorMap Find function crash [SOLVED] [message #55922] Sun, 03 January 2021 21:32
Xemuth is currently offline  Xemuth
Messages: 387
Registered: August 2018
Location: France
Senior Member
The problem come from destruction of data then working on it.

Hello, I have the following class :
template <class T>
class DataManager{
	public:
            T& Create(const String& name)
            /*
            ...
            */
             bool Remove(const String& name){
		int position = map.Find(name); //Crash occure here
		if(position != -1){
		    //Then we remove it
		    map.Remove(position);
		    return true;
		}
		return false;
	      }
	private:
	     friend class SGLRenderer;
	     VectorMap<String, T> map;
};


For some reason calling Remove function make my program crash at the following line :
int position = map.Find(name);

When digging. the function :
int Index<T>::FindFrom(int i, dword sh, const T& k, int end) const

can't be accessed through debugger, it crash when called. Any idea on what's i'm, doing wrong ?
https://i.imgur.com/WnueDN4.png

If I try to call GetCount() on my map, it return 1701147206. which is obviously a bad value. Do it mean my VectorMap has bad reference or something ?

[Updated on: Sun, 03 January 2021 21:45]

Report message to a moderator

Previous Topic: Modal DropList
Next Topic: function javascript after ajax U++ / Skylark08 tutorial
Goto Forum:
  


Current Time: Sat Dec 14 14:09:10 CET 2024

Total time taken to generate the page: 0.02962 seconds