It was probably going to happen anyway. If you just want to fix it, you can use epoxy or whatever to reattach as a temporary fix... doesn't look as purdy though.
Other ways is to recreate the barrel/receiver part and then bolt it in extra hard into the barrel. Kinda like this:
There might be a cleaner way of doing that, but that's the rough idea.