[5.31 beta 1 x86] JSON debug error

Just starting out? Need help? Post your questions and find answers here.
Phlos
User
User
Posts: 85
Joined: Fri May 16, 2003 7:17 pm

[5.31 beta 1 x86] JSON debug error

Post 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.
Olby
Enthusiast
Enthusiast
Posts: 461
Joined: Mon Jan 12, 2009 10:33 am
Contact:

Re: [5.31 beta 1 x86] JSON debug error

Post by Olby »

Confirmed, same on 5.30.
Intel Core i7 Quad 2.3 Ghz, 8GB RAM, GeForce GT 630M 2GB, Windows 10 (x64)
User avatar
ts-soft
Always Here
Always Here
Posts: 5756
Joined: Thu Jun 24, 2004 2:44 pm
Location: Berlin - Germany

Re: [5.31 beta 1 x86] JSON debug error

Post by ts-soft »

Confirmed, same on 5.31 x64
PureBasic 5.73 | SpiderBasic 2.30 | Windows 10 Pro (x64) | Linux Mint 20.1 (x64)
Old bugs good, new bugs bad! Updates are evil: might fix old bugs and introduce no new ones.
Image
freak
PureBasic Team
PureBasic Team
Posts: 5944
Joined: Fri Apr 25, 2003 5:21 pm
Location: Germany

Re: [5.31 beta 1 x86] JSON debug error

Post 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
quidquid Latine dictum sit altum videtur
Post Reply