Usually, an object becomes invalid because its operation depends on another Gambas object, or on another non-Gambas internal element, that was destroyed.
For example, if the user destroys a window by closing it, the corresponding Form or Window Gambas object is not destroyed, but becomes invalid.