Can not unfreeze Rigidbody.constraints after setting Rigidbody.centerOfMass

This code works fine:

	void Start () 
	{
		m_Rigidbody = GetComponent<Rigidbody>();
//		m_Rigidbody.centerOfMass = new Vector3(0,0,0);
		m_Rigidbody.constraints = RigidbodyConstraints.FreezeRotation;
	}

	void Update () 
	{
		m_Rigidbody.constraints = RigidbodyConstraints.None;
		Debug.Log(m_Rigidbody.constraints);
	}

But this freezes rotation of my rigidbody forever:

	void Start () 
	{
		m_Rigidbody = GetComponent<Rigidbody>();
		m_Rigidbody.centerOfMass = new Vector3(0,0,0);
		m_Rigidbody.constraints = RigidbodyConstraints.FreezeRotation;
	}

	void Update () 
	{
		m_Rigidbody.constraints = RigidbodyConstraints.None;
		Debug.Log(m_Rigidbody.constraints);
	}

Also, Debug.Log(m_Rigidbody.constraints); prints None. In both samples.

Solved problem by myself.
Helped to save:

m_inertia_tensor = m_Rigidbody.inertiaTensor;

before freezing rotations and then

m_Rigidbody.inertiaTensor = m_inertia_tensor;

after unfreezing rotations.

And if I don’t touch m_Rigidbody.centerOfMass in code, inertia tensor restores its value after unfreezing rotations. Wired…