On One's Last Legs Meaning

(idiomatic, by extension) About to lose viability or become defunct.

Example: 1824, Sir Walter Scott, St. Ronan's Well, ch. 6:
  [A] friend who assists me with a view to future profit . . . lies like the fox's scent when on his last legs, increasing every moment.
1913, Jack London, The Valley of the Moon, ch. 6:
  He is on his last legs. His kidneys are 'most gone. Remember, 'tis I must bury him.
1905, Robert Louis Stevenson, "The Beach of Falesa" in Island Nights' Entertainments:
  [T]he wood was main dark, but had a kind of a low glow in it like a fire on its last legs.