Page 1 of 1

[5.31 beta 1 x86] JSON debug error

Posted: Thu Sep 04, 2014 2:23 pm
by Phlos
Hello,

Code: Select all

Handle = CreateJSON(#PB_Any)
If Handle
  If ParseJSON(Handle, "{}")
  EndIf
  FreeJSON(Handle)
EndIf
When you run this code with debugger, it breaks and says "[ERROR] #JSON object number is very high (over 10000), are You sure of that ?"
Not a big issue, but annoying because it pauses application each time you run this code inside a debugger. :cry:

Thanks.

Re: [5.31 beta 1 x86] JSON debug error

Posted: Thu Sep 04, 2014 2:49 pm
by Olby
Confirmed, same on 5.30.

Re: [5.31 beta 1 x86] JSON debug error

Posted: Thu Sep 04, 2014 3:30 pm
by ts-soft
Confirmed, same on 5.31 x64

Re: [5.31 beta 1 x86] JSON debug error

Posted: Sun Sep 21, 2014 12:09 am
by freak
Your code is incorrect.

The ParseJSON function creates a _new_ JSON object, so passing it the result of a previous #PB_Any object is wrong. You have to pass #PB_Any if you want to create another dynamic object.

It is the same situation as with any other library:

Code: Select all

Handle = CreateImage(#PB_Any, 100, 100)
If Handle
  If LoadImage(Handle, "myImage.png")
  EndIf
  FreeImage(Handle)
EndIf