Skip to content
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 10 additions & 0 deletions changelog.in
Original file line number Diff line number Diff line change
Expand Up @@ -75,6 +75,16 @@ This release modernizes the Gecode build infrastructure, adds a
first-class CMake package for downstream consumers, refreshes the
autoconf build path, and updates CI coverage for current platforms.

[ENTRY]
Module: kernel
What: bug
Rank: minor
Issue: 62
Thanks: k0stjap
[DESCRIPTION]
Dispose the random view selector used by random variable branching so
its random generator handle is released when the brancher is discarded.

[ENTRY]
Module: float
What: bug
Expand Down
14 changes: 14 additions & 0 deletions gecode/kernel/branch/view-sel.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -182,6 +182,10 @@ namespace Gecode {
//@{
/// Create copy during cloning
virtual ViewSel<View>* copy(Space& home);
/// Whether dispose must always be called (that is, notice is needed)
virtual bool notice(void) const;
/// Delete view selection
virtual void dispose(Space& home);
//@}
};

Expand Down Expand Up @@ -539,6 +543,16 @@ namespace Gecode {
ViewSelRnd<View>::copy(Space& home) {
return new (home) ViewSelRnd<View>(home,*this);
}
template<class View>
forceinline bool
ViewSelRnd<View>::notice(void) const {
return true;
}
template<class View>
forceinline void
ViewSelRnd<View>::dispose(Space&) {
r.~Rnd();
}


template<class Val>
Expand Down
Loading