Wow, I'm glad I read to the end of this thread. I just tried this method and this worked. I didn't want to use glue (seemed scary). Didn't end up needing to.
The very tip of the headphone adapter (a headphone to RCA adapter in my case) was stuck in the jack of my girlfriend's computer. The tip has a small point sticking out that goes into the hollow space on the second section of the adapter.
I put the broken adapter (which still had the first two sections intact) gently into the jack, so that the part which broke off inside was now inside the hollow section of the adapter. When I had tried just pulling it out after doing this, it didn't work -- there was nothing to stick the two parts of the adapter together. But after reading this post, I tried twisting the adapter after inserting it into the jack. I think I twisted it clockwise. I then pulled, and the whole thing came out! Thanks!
It looks like there's some threading on the tip of the adapter, which I guess interfaced with some threading inside the second section, causing them to stick together enough so that when I pulled, they came out together.
If more than one section of the adapter is broken inside the jack, this method likely won't work for you -- but if it's just the tip that's in there, definitely give this a try. Much safer than superglue. I don't think there's really any way this could damage your computer, unless you push on it way too hard or something.