You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Here is the error we are getting when we try to make an http request using afmotion 3. Working on a reduction now to see where the issue is coming from.
Control Application(22482,0x70000f68d000) malloc: *** error for object 0x1011680e0: pointer being realloc'd was not allocated
Control Application(22482,0x70000f68d000) malloc: *** set a breakpoint in malloc_error_break to debug
The text was updated successfully, but these errors were encountered:
Here's an app delegate file which shows the issues with the JSON put request. send_json and send_json_1 both crash the app with a malloc error. send_get works as expected
class AppDelegate
def applicationDidFinishLaunching(notification)
buildMenu
# send_get
#first attempt, format json in hash and send (used to work with AFMotion 2)
json = {"on"=>true, "sat"=>128, "bri"=>254, "hue"=>10000}
# send_json(json)
#second attempt, format as per docs on home page
send_json_1(json)
end
def send_get
AFMotion::HTTP.get("http://google.com", params: { q: "rubymotion" }) do |result|
NSLog result.body.to_s
end
end
def send_json(json)
NSLog "sending HTTP request now.. #{json}"
AFMotion::JSON.put("http://localhost:5000/api/101011101001/groups/0/action", params: {on: true, sat: 128, bri: 254, hue: 10000}) do |result|
NSLog result.body.to_s
end
end
def send_json_1(json)
NSLog "sending HTTP request now.. #{json}"
AFMotion::JSON.put("http://localhost:5000/api/101011101001/groups/0/action", params: json) do |result|
NSLog result.body.to_s
end
end
end
Here is the error we are getting when we try to make an http request using afmotion 3. Working on a reduction now to see where the issue is coming from.
The text was updated successfully, but these errors were encountered: