A method of controlling a crane, said crane comprising: - a movable arm, - at least one first hydraulic device (3, 4, 5) configured to move the movable arm, - a first hydraulic valve (6, 7, 8) configured to control the operation of the at least one first hydraulic device (3, 4, 5), - a tool provided at an end of the movable arm, said tool comprising a first part and a second part, - a second hydraulic device configured to displace said first part in relation to said second part to a holding position in which the tool is configured to hold an object, - a second hydraulic valve configured to control the operation the second hydraulic device, - a control system comprising - a readable memory, - a user interface configured to enable a user to control the movable arm and the tool by receiving user commands, and - a processor configured to control the first hydraulic device (3, 4, 5) and the second hydraulic device by generating control signals to the first hydraulic valve (6, 7, 8) and to the second hydraulic valve in response to said received user commands, said method being characterized in that it comprises the steps of a) detecting a first condition in which the tool is in said holding position and the movable arm is in an unloaded condition in which it is not actively lifting an object held by said tool, b) registering a first point of time at which the first condition is obtained and counting a period of time (t) from the first point of time, and c) when the counted period of time (t) exceeds a threshold value (t threshold), activating a safe operation mode in the control system which prevents the first hydraulic device (3, 4, 5) from moving the movable arm, said safe operation mode being deactivatable by an actuation of said second hydraulic valve. - a movable arm, - at least one first hydraulic device (3, 4, 5) configured to move the movable arm, - a first hydraulic valve (6, 7, 8) configured to control the operation of the at least one first hydraulic device (3, 4, 5), - a tool provided at an end of the movable arm, said tool comprising a first part and a second part, - a second hydraulic device configured to displace said first part in relation to said second part to a holding position in which the tool is configured to hold an object, - a second hydraulic valve configured to control the operation the second hydraulic device, - a control system comprising - a readable memory, - a user interface configured to enable a user to control the movable arm and the tool by receiving user commands, and - a processor configured to control the first hydraulic device (3, 4, 5) and the second hydraulic device by generating control signals to the first hydraulic valve (6, 7, 8) and to the second hydraulic valve in response to said received user commands, said method being characterized in that it comprises the steps of a) detecting a first condition in which the tool is in said holding position and the movable arm is in an unloaded condition in which it is not actively lifting an object held by said tool, b) registering a first point of time at which the first condition is obtained and counting a period of time (t) from the first point of time, and c) when the counted period of time (t) exceeds a threshold value (t threshold), activating a safe operation mode in the control system which prevents the first hydraulic device (3, 4, 5) from moving the movable arm, said safe operation mode being deactivatable by an actuation of said second hydraulic valve. - a readable memory, - a user interface configured to enable a user to control the movable arm and the tool by receiving user commands, and - a processor configured to control the first hydraulic device (3, 4, 5) and the second hydraulic device by generating control signals to the first hydraulic valve (6, 7, 8) and to the second hydraulic valve in response to said received user commands, said method being characterized in that it comprises the steps of a) detecting a first condition in which the tool is in said holding position and the movable arm is in an unloaded condition in which it is not actively lifting an object held by said tool, b) registering a first point of time at which the first condition is obtained and counting a period of time (t) from the first point of time, and c) when the counted period of time (t) exceeds a threshold value (t threshold), activating a safe operation mode in the control system which prevents the first hydraulic device (3, 4, 5) from moving the movable arm, said safe operation mode being deactivatable by an actuation of said second hydraulic valve. a) detecting a first condition in which the tool is in said holding position and the movable arm is in an unloaded condition in which it is not actively lifting an object held by said tool, b) registering a first point of time at which the first condition is obtained and counting a period of time (t) from the first point of time, and c) when the counted period of time (t) exceeds a threshold value (t threshold), activating a safe operation mode in the control system which prevents the first hydraulic device (3, 4, 5) from moving the movable arm, said safe operation mode being deactivatable by an actuation of said second hydraulic valve.