diff --git a/FcSolveSolver-cleanup-ressources.patch b/FcSolveSolver-cleanup-ressources.patch new file mode 100644 index 0000000..9773595 --- /dev/null +++ b/FcSolveSolver-cleanup-ressources.patch @@ -0,0 +1,37 @@ +From d7fcc9a0c79f186118e0c20804af1f7467fc4580 Mon Sep 17 00:00:00 2001 +From: Fabian Kosmale <0inkane@googlemail.com> +Date: Thu, 29 Aug 2019 18:33:13 +0200 +Subject: FcSolveSolver: cleanup ressources + +The FcSolveSolver did not call its free function in patsolve, leading to +ressource exhaustion. + +BUG: 395624 +--- + patsolve/abstract_fc_solve_solver.cpp | 10 ++++++++++ + 1 file changed, 10 insertions(+) + +diff --git a/patsolve/abstract_fc_solve_solver.cpp b/patsolve/abstract_fc_solve_solver.cpp +index c82aee1..725c703 100644 +--- a/patsolve/abstract_fc_solve_solver.cpp ++++ b/patsolve/abstract_fc_solve_solver.cpp +@@ -55,6 +55,16 @@ SolverInterface::ExitStatus FcSolveSolver::patsolve( int _max_positions ) + + init(); + ++ // call free once the function ends. ### Replace this mess with QScopeGuard once we can use Qt 5.12 ++ auto cleanup = [this](){this->free();}; ++ using CleanupFunction = decltype (cleanup); ++ struct CleanupHandler { ++ CleanupHandler(CleanupFunction cleanup) : m_cleanup(std::move(cleanup)) {} ++ ~CleanupHandler() { m_cleanup();} ++ ++ CleanupFunction m_cleanup; ++ } cleaner(cleanup); ++ + int no_use = 0; + int num_moves = 0; + const auto get_possible_moves__ret = get_possible_moves(&no_use, &num_moves); +-- +cgit v1.1 + diff --git a/kpat.changes b/kpat.changes index b76910a..dfe3a46 100644 --- a/kpat.changes +++ b/kpat.changes @@ -1,3 +1,9 @@ +------------------------------------------------------------------- +Sat Sep 7 20:33:21 UTC 2019 - Wolfgang Bauer + +- Add FcSolveSolver-cleanup-ressources.patch to fix crashes due to + resource exhaustion (boo#1146622, kde#395624) + ------------------------------------------------------------------- Thu Sep 5 14:00:53 UTC 2019 - Luca Beltrame diff --git a/kpat.spec b/kpat.spec index 004e7b7..1bb152a 100644 --- a/kpat.spec +++ b/kpat.spec @@ -32,6 +32,8 @@ Source: https://download.kde.org/stable/applications/%{version}/src/%{na Source1: https://download.kde.org/stable/applications/%{version}/src/%{name}-%{version}.tar.xz.sig Source2: applications.keyring %endif +# PATCH-FIX-UPSTREAM +Patch0: FcSolveSolver-cleanup-ressources.patch BuildRequires: extra-cmake-modules BuildRequires: freecell-solver-devel BuildRequires: kcompletion-devel @@ -81,6 +83,7 @@ more. The game has nice graphics and many different carddecks. %prep %setup -q +%autopatch -p1 %build %cmake_kf5 -d build