Search in
Sort by:

Question Status:

Search help

  • Simple searches use one or more words. Separate the words with spaces (cat dog) to search cat,dog or both. Separate the words with plus signs (cat +dog) to search for items that may contain cat but must contain dog.
  • You can further refine your search on the search results page, where you can search by keywords, author, topic. These can be combined with each other. Examples
    • cat dog --matches anything with cat,dog or both
    • cat +dog --searches for cat +dog where dog is a mandatory term
    • cat -dog -- searches for cat excluding any result containing dog
    • [cats] —will restrict your search to results with topic named "cats"
    • [cats] [dogs] —will restrict your search to results with both topics, "cats", and "dogs"

[Closed] Packaging Fails, can Launch and Cook

I am new to UE4. Building from source with /EHsc set. Using boost asio, threading, some other boost stuff.

I was able to package last night, but as of changes I made today, I cannot. The logs are not very helpful to my untrained eye. I spent several hours looking around and trying various things but no success.



I can 'Cook content for Windows' and launch no problem.

Edit: Also may or may not be related. I will crash if I click the 'compile' button in the editor, instead of stopping, and compiling/relaunching the editor fresh from VS. This is cause by closing a socket in an actors destructor.

Edit 2: Ah! I noticed right before I crash that the packaging process is logging into my server?! This is also what is occurring in the 'compile' button crashes.

Edit 3: OK getting closer! So question. When does UE4 execute parts of my code when my game isn't running, and what does it execute? I have been searching but can not seem to find answers.

So I am binding a class members (the inherited AGameMode class) shared pointer to a thread, to a make_shared thread created in that classes constructor, which takes a data member (io_service) of the class. I am joining that thread in the classes destructor. My problem seems to be in the constructor there. I can get around it by adding a data member 'created' etc that I set to true at the end of the constructor, and check before joining the thread in the destructor. I also have to do this in the class containing the socket, so the close function is not called in the inherited AGameMode classes destructor. However I have not yet structured this correctly, so I am still getting the same crash when not commenting out the socket owning class. I do have it packaging with just the thread though. Not sure what the proper what to handle this is, for now it works though. Very interested in the proper way, and also the question above in bold.

Edit 4: OK getting closer. I think the problem is that my socket containing class could possibly throw an exception, meaning the destructor may never be called?

Product Version: UE 4.10
more ▼

asked Dec 12 '15 at 08:21 AM in Packaging & Deployment

avatar image

26 2 4

(comments are locked)
10|2000 characters needed characters left
Viewable by all users

The question has been closed Jul 07 '16 at 03:12 PM by Samantha Sutton for the following reason:

The question is answered, right answer was accepted

1 answer: sort voted first

OK Solved! Constructors are called when launching the editor and when packaging. Moving my processes from constructor/destructor into BeginPlay() and EndPlay() fixed everything.

This answer explains it a bit more: https://answers.unrealengine.com/questions/257952/recompile-hot-reload-executes-constructor-of-agame.html

more ▼

answered Dec 12 '15 at 10:33 PM

avatar image

26 2 4

(comments are locked)
10|2000 characters needed characters left
Viewable by all users

Follow this question

Once you sign in you will be able to subscribe for any updates here

Answers to this question