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 » Developing U++ » U++ Developers corner » ASSERT when using ValueMap
ASSERT when using ValueMap [message #47651] Tue, 21 February 2017 16:23 Go to previous message
NilaT is currently offline  NilaT
Messages: 70
Registered: November 2011
Location: Austria
Member
Hello everyone, I've got a nice little "soft crash" again, may you can help me?
It happens when I try to "Add" something to a Value Map.
So my code basically looks like this:
Params params = HandleParams(param1, param2); // Params is a struct which contains some Strings, some ints, and a Time Variable
ValueMap result;
result.Add("key1", RawToValue(params.someVar));

It then crashes at:
****************** ASSERT FAILED: Assertion failed in C:\.....\uppsrc_2016\Core\Value.cpp, line 25
ptr()->GetType() >= 255 || !svo[ptr()->GetType()]

which happens to occur in the Value Destructor, ::RefRelease() to be exact.
Why is this happening??


Oh and another thing I already fixed, but it also bothers me:
ValueMap map = rpc["params"]; // rpc = RpcData type
int x = ValueTo<int>(map["someKey"]);

will crash, because it says invalid value convertion, double --> int
Why the heck is map["someKey"] a double value, when it's int?
I fixed it by using:
(int)ValueTo<double>(map["someKey"]);

Not nice... but works.

Thanks again for your help.
 
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Previous Topic: C2280
Next Topic: Use zlib inside another library
Goto Forum:
  


Current Time: Sun Apr 28 09:25:41 CEST 2024

Total time taken to generate the page: 0.03210 seconds