Skip to content

Commit

Permalink
Refactor: Minor Fixes
Browse files Browse the repository at this point in the history
  • Loading branch information
TwinFan committed Dec 16, 2023
1 parent f086387 commit 6383cec
Show file tree
Hide file tree
Showing 5 changed files with 5 additions and 7 deletions.
2 changes: 1 addition & 1 deletion Lib/XPMP2
Submodule XPMP2 updated 1 files
+1 −1 src/Sound.cpp
2 changes: 1 addition & 1 deletion Src/ACTable.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -475,7 +475,7 @@ bool ACTable::UpdateFDIs (const std::string& _filter)
std::vector<FDInfo> vecAgain;
for (const mapLTFlightDataTy::value_type& p: mapFd) {
// First filter: Visible a/c only?
if (bFilterAcOnly && !p.second.hasAc())
if (bFilterAcOnly && (!p.second.hasAc() || !p.second.GetAircraft()->IsVisible()))
continue;
// others: test if filter matches
FDInfo fdi(p.second);
Expand Down
2 changes: 1 addition & 1 deletion Src/InfoListWnd.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -135,7 +135,7 @@ void InfoListWnd::buildInterface()
TabActive(ILW_TAB_AC_LIST);

// Limit to visible planes only
ImGui::Checkbox("Only displayed a/c", &acList.bFilterAcOnly);
ImGui::Checkbox("Only visible a/c", &acList.bFilterAcOnly);

// Search a setting
// If there is a search text then the tree nodes will be suppressed,
Expand Down
1 change: 0 additions & 1 deletion Src/LTChannel.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -920,7 +920,6 @@ void LTFlightDataAcMaintenance()
{
// access guarded by a mutex
LTFlightData& fd = i->second;
std::lock_guard<std::recursive_mutex> lockFd (fd.dataAccessMutex);
// do the maintenance, remove aircraft if that's the verdict
if ( fd.AircraftMaintenance(simTime) )
i = mapFd.erase(i);
Expand Down
5 changes: 2 additions & 3 deletions Src/LTOpenGlider.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -785,11 +785,10 @@ bool OpenGliderConnection::AcListDownloadMain ()
// Download the file
bool bRet = false;
try {
char curl_errtxt[CURL_ERROR_SIZE];
OGNCbHandoverTy ho; // hand-over structure to callback

// initialize the CURL handle
CURL *pCurl = curl_easy_init();
pCurl = curl_easy_init();
if (!pCurl) {
LOG_MSG(logERR,ERR_CURL_EASY_INIT);
return false;
Expand Down Expand Up @@ -826,7 +825,6 @@ bool OpenGliderConnection::AcListDownloadMain ()
if (cc == CURLE_OK)
{
// CURL was OK, now check HTTP response code
long httpResponse = 0;
curl_easy_getinfo(pCurl, CURLINFO_RESPONSE_CODE, &httpResponse);

// not HTTP_OK?
Expand All @@ -846,6 +844,7 @@ bool OpenGliderConnection::AcListDownloadMain ()

// cleanup CURL handle
curl_easy_cleanup(pCurl);
pCurl = nullptr;
}
catch (const std::exception& e) {
LOG_MSG(logERR, "Fetching OGN a/c list failed with exception %s", e.what());
Expand Down

0 comments on commit 6383cec

Please sign in to comment.