Commit Graph

47951 Commits

Author SHA1 Message Date
Jonathan G Rennison
01f957c51f Fix: Crash due to use of invalid iterator in ClientNetworkContentSocketHandler
In particular this crash can be observed when using the
bootstrap GUI to download the base graphics.

In ClientNetworkContentSocketHandler::OnReceiveContentInfo
ClientNetworkContentSocketHandler::callbacks is iterated, using an iterator
cb->OnReceiveContentInfo() is called (cb is of type BootstrapAskForDownloadWindow)
This calls new BootstrapContentDownloadStatusWindow()
This inherits from BaseNetworkContentDownloadStatusWindow
The constructor of which calls _network_content_client.AddCallback(this)
This reallocates the std::vector which is being iterated in ClientNetworkContentSocketHandler::OnReceiveContentInfo
This results in iter being invalid, and an assertion failure occurs shortly
afterwards due to its use in the next iteration of cb->OnReceiveContentInfo()

Adjust all locations where ClientNetworkContentSocketHandler::callbacks
is iterated to avoid problematic behaviour
2019-04-09 22:56:23 +02:00
Michael Lutz
8b1880187a Remove: AutoFreeSmallVector.
The last use was for storing a list of memory blocks. As the way these lists are accessed is very
specific, it is easier to just write an explicit destructor instead of trying to exactly match the behaviour.
2019-04-09 22:45:15 +02:00
Michael Lutz
e804173595 Codechange: If something is a vector of strings, use a vector of strings instead of an AutoFreeSmallVector. 2019-04-09 22:45:15 +02:00
Michael Lutz
c7b9987d08 Codechange: Switch DropDownList to directly use std::vector, thus making AutoDeleteSmallVector obsolete.
DropDownListItem are strongly managed using std::unique_ptr to ensure leak-free handling. Appropriate use
of move-semantics make intent a lot clearer than parameter comments and allows the compiler to generate
copy-free code for most situations.
2019-04-09 22:45:15 +02:00
Michael Lutz
d3e113eb5f Codechange: Use std::vector instead of AutoDeleteSmallVector in GS text handling. 2019-04-09 22:45:15 +02:00
Michael Lutz
baf9229931 Codechange: Replace AutoDeleteSmallVector with direct std::vector use in text layout code. 2019-04-09 22:45:15 +02:00
Michael Lutz
329bb52613 Codechange: Store text layout runs directly as values in a std::vector instead of heap allocated.
This reduces memory allocations and heap fragmentation.
2019-04-09 22:45:15 +02:00
Michael Lutz
9325d63d8e Fix: Forgotten override keywords for DropDownListIconItem. 2019-04-09 22:45:15 +02:00
Michael Lutz
fbc4cef180 Codechange: Use override specifier for text layout classes. 2019-04-09 22:45:15 +02:00
Michael Lutz
d95c7083ea Fix: Don't crash if reading a GS string file from disk produces an error.
The raw_strings vector may not include NULLs as no consumer can deal with it.
2019-04-09 22:45:15 +02:00
Jonathan G Rennison
58c27ab59e Merge branch 'crashlog_improvements' into jgrpp 2019-04-09 19:30:29 +01:00
Jonathan G Rennison
69d2d3e278 Crashlog: Limit total number of news items 2019-04-09 19:29:27 +01:00
Jonathan G Rennison
d5ee9d34da Merge branch 'cpp-11' into crashlog_improvements
# Conflicts:
#	Makefile.src.in
#	projects/determineversion.vbs
#	source.list
#	src/crashlog.cpp
#	src/misc.cpp
#	src/os/unix/crashlog_unix.cpp
#	src/os/windows/crashlog_win.cpp
#	src/rev.h
#	src/thread/thread.h
#	src/thread/thread_morphos.cpp
#	src/thread/thread_none.cpp
#	src/thread/thread_os2.cpp
#	src/thread/thread_pthread.cpp
#	src/thread/thread_win32.cpp
2019-04-09 19:21:39 +01:00
Jonathan G Rennison
361758b516 Merge branches 'crashlog_improvements', 'save_ext' into jgrpp
# Conflicts:
#	Makefile.src.in
#	projects/openttd_vs140.vcxproj
#	projects/openttd_vs140.vcxproj.filters
#	projects/openttd_vs141.vcxproj
#	projects/openttd_vs141.vcxproj.filters
#	projects/openttd_vs142.vcxproj
#	projects/openttd_vs142.vcxproj.filters
#	src/core/smallstack_type.hpp
#	src/linkgraph/linkgraphjob.cpp
#	src/linkgraph/linkgraphjob.h
#	src/misc.cpp
#	src/network/network_udp.cpp
#	src/openttd.cpp
#	src/saveload/saveload.cpp
2019-04-09 19:06:26 +01:00
Jonathan G Rennison
7f80884047 Merge branch 'cpp-11' into save_ext
# Conflicts:
#	src/saveload/saveload.cpp
#	src/settings.cpp
#	src/settings_gui.cpp
2019-04-09 18:54:02 +01:00
Jonathan G Rennison
01261daec0 Merge branch 'master' into cpp-11
# Conflicts:
#	config.lib
2019-04-09 18:47:28 +01:00
translators
0a883afe19 Update: Translations from eints
luxembourgish: 20 changes by Phreeze
2019-04-09 19:45:42 +02:00
Jonathan G Rennison
070160af40 Save point used when adding station to viewport kd tree, use for removal 2019-04-09 02:32:28 +01:00
Jonathan G Rennison
3807f0551d Limit maximum recursion depth in StationViewWindow::EstimateDestinations 2019-04-09 01:49:18 +01:00
peter1138
72b72dbec3 Add: Press ctrl to build diagonal rivers in scenario editor. 2019-04-08 22:32:33 +01:00
PeterN
812886ca61
Fix #7478: Don't remove NewGRF objects on company take-over. (#7483) 2019-04-08 19:20:43 +01:00
kiwitreekor
bc9b47d2e5 Fix #6222: Advanced sprite layout sometimes showed incorrect railtype ground tile 2019-04-08 18:41:07 +01:00
Jonathan G Rennison
99055c22cb Fix string format issue in Japanese translation 2019-04-08 17:38:10 +01:00
Jonathan G Rennison
c0b402a74c Merge branch 'pr-82' into jgrpp 2019-04-08 17:30:02 +01:00
Jonathan G Rennison
99f3ebe1fd Merge branch 'pr-78' into jgrpp 2019-04-08 17:28:33 +01:00
Jonathan G Rennison
74e5e04724 Fix: Crash due to use of invalid iterator in ClientNetworkContentSocketHandler
In particular this crash can be observed when using the
bootstrap GUI to download the base graphics.

In ClientNetworkContentSocketHandler::OnReceiveContentInfo
ClientNetworkContentSocketHandler::callbacks is iterated, using an iterator
cb->OnReceiveContentInfo() is called (cb is of type BootstrapAskForDownloadWindow)
This calls new BootstrapContentDownloadStatusWindow()
This inherits from BaseNetworkContentDownloadStatusWindow
The constructor of which calls _network_content_client.AddCallback(this)
This reallocates the std::vector which is being iterated in ClientNetworkContentSocketHandler::OnReceiveContentInfo
This results in iter being invalid, and an assertion failure occurs shortly
afterwards due to its use in the next iteration of cb->OnReceiveContentInfo()

Adjust all locations where ClientNetworkContentSocketHandler::callbacks
is iterated to avoid problematic behaviour
2019-04-08 12:03:28 +01:00
nikolas
eab8ab40d9
Fix typo in readme: sufficienty -> sufficiently 2019-04-07 23:31:17 -04:00
glx22
3e608afa6c
Fix: [Windows] OpenTTD window may be inactive when an error happens (#7482) 2019-04-07 21:52:30 +02:00
Michael Lutz
967b27a2c1 Codechange: C++11 STL has a function for getting the number of CPU cores. 2019-04-06 11:27:39 +02:00
Michael Lutz
ae748166d0 Codechange: Use platform independent C++11 function for sleeping on a thread. 2019-04-06 11:27:39 +02:00
Michael Lutz
94c5269fa7 Codechange: Use atomic variables for thread synchronization where useful. 2019-04-06 11:27:39 +02:00
Michael Lutz
05bc2ed7cb Codechange: Replace custom thread code with C++11 thread objects.
We assume a conforming C++11 compiler environment that has a valid <thread>-header.
Failure to run a real thread is handled gracefully.
2019-04-06 11:27:39 +02:00
Michael Lutz
05f4e73608 Codechange: Replace custom mutex code with C++11 mutex'es.
A conforming compiler with a valid <mutex>-header is expected.
Most parts of the code assume that locking a mutex will never fail unexpectedly,
which is generally true on all common platforms that don't just pretend to
be C++11. The use of condition variables in driver code is checked.
2019-04-06 11:27:39 +02:00
Michael Lutz
3b86f54fc7 Fix: [OSX] .mm files are C++ files, not C files. 2019-04-06 11:27:39 +02:00
glx22
90a91f1d0d
Fix: [MSVC] don't force SDK version (#7474) 2019-04-05 21:07:06 +02:00
glx22
a1e492d0d8
Fix #7439: don't overwrite CompanyRemoveReason with ClientID (#7465) 2019-04-05 15:11:52 +02:00
Samu
fb6e31ca43 Cleanup 3f32711: Don't apply forbid 90 deg turn settings for ships. 2019-04-05 10:03:54 +01:00
Jonathan G Rennison
a6887d7010 Version: Committing version data for tag: jgrpp-0.30.1 2019-04-05 01:37:21 +01:00
Jonathan G Rennison
4bf4862674 Add AI/game script DoCommand calls to command log 2019-04-04 23:43:54 +01:00
Jonathan G Rennison
c3e90b61b7 Merge branch 'master' into jgrpp
# Conflicts:
#	src/vehicle_cmd.cpp
2019-04-04 23:39:29 +01:00
peter1138
8114bad033 Fix #7469: Desync when using build and refit feature. 2019-04-04 23:29:43 +01:00
Patric Stout
c99f731f89 Update: documentation updates from 1.9 branch 2019-04-05 00:19:41 +02:00
Jonathan G Rennison
a0c8bd2164 Version: Committing version data for tag: jgrpp-0.30.0 2019-04-03 23:57:29 +01:00
Jonathan G Rennison
5de3d907a0 version_utils.sh: Allow .ottdrev-vc to be dirty at release time 2019-04-03 23:57:24 +01:00
Jonathan G Rennison
44c8696b2a Fix Win32 compilation with WITH_DBGHELP on non-MSVC 2019-04-03 23:54:55 +01:00
Jonathan G Rennison
a404db80f6 Merge branch 'master' into jgrpp
# Conflicts:
#	src/town_cmd.cpp
2019-04-03 23:37:41 +01:00
Jonathan G Rennison
7b36bba766 Fix max value for zoning overlay settings 2019-04-03 23:19:12 +01:00
Jonathan G Rennison
cd2b2f4c04 Add details to SettingEntry::Init assertion failure message 2019-04-02 20:46:20 +01:00
translators
24fc25164a Update: Translations from eints
french: 3 changes by glx
croatian: 17 changes by VoyagerOne
2019-04-02 19:45:45 +02:00
Jonathan G Rennison
5242ec4642 Fix handling of GRF programmable signal graphics with trace restrict 2019-04-02 18:19:28 +01:00