Vladimir Berezniker | 25 Jun 2012 04:31

[PATCH] JavaHL: Support commit callback across method invocations

In case of delta editor, commit callback is provided at the time of the editor
creation and used during the close_edit() call. For that there is a need to
keep a global reference to the underlying java object so that it does not get
GCed meanwhile.

Attached please find the patch that adds such capabilities.

Thank you,

Vladimir

[[[
JavaHL: Support keeping global reference to the callback java object for cases
when callback is being used across method calls

[ in subversion/bindings/javahl/native ]

* CommitCallback.cpp,
  CommitCallback.h
  (CommitCallback, ~CommitCallback): Add handling of additional parameter and
    state when requesting a global reference to be kept
]]]
Index: subversion/bindings/javahl/native/CommitCallback.h
===================================================================
--- subversion/bindings/javahl/native/CommitCallback.h	(revision 1353380)
+++ subversion/bindings/javahl/native/CommitCallback.h	(working copy)
 <at>  <at>  -37,7 +37,7  <at>  <at> 
 class CommitCallback
(Continue reading)

Hyrum K Wright | 26 Jun 2012 21:21
Favicon

Re: [PATCH] JavaHL: Support commit callback across method invocations

On Sun, Jun 24, 2012 at 8:31 PM, Vladimir Berezniker <vmpn <at> hitechman.com> wrote:
> In case of delta editor, commit callback is provided at the time of the editor
> creation and used during the close_edit() call. For that there is a need to
> keep a global reference to the underlying java object so that it does not get
> GCed meanwhile.
>
> Attached please find the patch that adds such capabilities.
>
> Thank you,
>
> Vladimir
>
> [[[
> JavaHL: Support keeping global reference to the callback java object for cases
> when callback is being used across method calls
>
> [ in subversion/bindings/javahl/native ]
>
> * CommitCallback.cpp,
>  CommitCallback.h
>  (CommitCallback, ~CommitCallback): Add handling of additional parameter and
>    state when requesting a global reference to be kept
> ]]]

I don't like putting the burden on the caller that constructs the
Commit callback to define whether a global reference should be held or
not.  Can't the thing consuming the callback reference make that
determination?

(Alternatively, could we have a subclass which keeps a global
(Continue reading)


Gmane