Suppose someone writes some code, and publishes it as open source under the GPL. Later they decide to close source their application and put it for sale. Is that in violation of the GPL? All code in the closed source app was written by the said author. Since he "owns" the code, I would think he can choose to re-license it however he wishes. Is that right?
Yes, if they wrote it, they own the copyright (unless they have assigned that copyright to someone else, of course, like their employer). The GPL confers extra rights to non-copyright-holders over and above what copyright law gives them.
The copyright owner is never technically in violation of the GPL since they have all the rights they need under copyright law.
What they can't do is to pull back the code already released under GPL, that would be covered by estoppel (basically: if someone does something based on a promise you made, you can't later withdraw that promise - it's an equitable thing).
But they can re-licence their code as much as they want, selling it commercially or even not releasing later versions at all.
Keep in mind I am not a lawyer (though I deal with them quite a bit), I am certainly not your lawyer, and this advice is worth every cent you paid for it (which is zero).
If you own the code and you have GPL'd it, you can't take it back. The best you can do is grant yourself (or someone else) the right to develop the code further under a closed model.
There was a semi-famous case of a few years back, with some software I actually use called pchdtvr. The guy who wrote it was a pretty good guy, but he tried to revoke the GPL from his code and basically got flamed right off the net. (Angry people basically forced him to shut down his domain, and he disappeared.) You could search for the package or search for his email,
So, closing your code and putting it up for sale is no problem. Trying to stop people from giving away your GPL'd code? Big problem.
You could try reading the GPL. Version 3 is at http://www.gnu.org/copyleft/gpl.html
The short answer is "NO". The grant of license is in perpetuity. The GPLv3 makes this explicit; earlier versions did not. Legal issues aside, once you've published your source code on the InterTubes with a license saying "go to town", there's the practical issue: how are you going take it back?
2. Basic Permissions.
All rights granted under this License are granted for the term of copyright on the Program, and are irrevocable provided the stated conditions are met. This License explicitly affirms your unlimited permission to run the unmodified Program. The output from running a covered work is covered by this License only if the output, given its content, constitutes a covered work. This License acknowledges your rights of fair use or other equivalent, as provided by copyright law.
Note: I'm no lawyer. I don't even play one on TV. This advice is worth every penny you paid for it. You need to consult an attorney who knows something about copyright law if the answer to this question is actually important.
Yes. The author can change their licensing terms at any time for any reason.
What happens to previous revisions of the code that were already distributed to others under the GPL is more of a gray area, however. The author can indicate that they no longer want their previous versions distributed, but they cannot legally require others to comply with this request. And in practical terms, once something is out there on the Internet, there's no reigning it back in regardless.