Why Sketchup crashes when cancel Class: Sketchup::Http::Request

It makes no sense to put a cancel call inside a loop without some kind of conditional expression.
Basically the first time through the loop the request would get cancelled.

You are using a local reference, ie: req

Since I cannot see all of your code, I cannot say. Is the code within a method ?

A persistent reference is an instance variable (@req,) or a class/module variable (@@req.)

From any good Ruby programming book. There are free ones available for download. See