Skip to content
Snippets Groups Projects
Commit 881ec5c0 authored by Florian Prill's avatar Florian Prill
Browse files

Merge branch 'feature-hl' of git.mpimet.mpg.de:libmtime into feature-hl

parents 4492ac67 f435144a
No related branches found
No related tags found
No related merge requests found
......@@ -31,11 +31,23 @@ module mtime_hl
contains
! !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
!
! The use of "final" is "potentially" dangerous - it is supported,
! e.g., on gfortran 4.9 only partially. (see
! http://fortranwiki.org/fortran/show/Fortran+2003+status)
!
! !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
! final :: t_datetime_deallocate
!
! final is required to prevent memory leaks, when variables go out
! of scope. So this routine will get called only in this case and
! the call is introduced by the compiler - nobody will see those.
! So I will reenable the final but not for gcc odler than gcc5.
!
! !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
#if __GNUC__ > 4
final :: t_datetime_deallocate
#endif
procedure :: to_string => t_datetime_to_string
procedure :: assign_string => t_datetime_assign_string
......@@ -73,8 +85,9 @@ module mtime_hl
contains
! final :: t_timedelta_deallocate
#if __GNUC__ > 4
final :: t_timedelta_deallocate
#endif
procedure :: to_string => t_timedelta_to_string
procedure :: assign_string => t_timedelta_assign_string
......@@ -85,13 +98,20 @@ module mtime_hl
contains
! !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
!
! In my opinion, this deallocate does not make sense, since the
! this%dt data member is a simply derived type (with C conforming
! kind values). The necessary deallocates happen in the wrapper
! routines, where a POINTER variable is used and its contents are
! copied to this%dt.
!
! !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
!
! You're right, but this routine is just the implementation of
! final, and no user should call it explicitly! BUt of course,
! you need to make the call available.
!
! !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
!
subroutine t_datetime_deallocate(this)
type(t_datetime), target, intent(inout) :: this
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment