Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
F
frama-c
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Deploy
Releases
Container Registry
Model registry
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
pub
frama-c
Commits
691d84e6
Commit
691d84e6
authored
5 years ago
by
Loïc Correnson
Browse files
Options
Downloads
Patches
Plain Diff
[server] states gc on signal
parent
266e9339
No related branches found
No related tags found
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
src/plugins/server/states.ml
+23
-8
23 additions, 8 deletions
src/plugins/server/states.ml
with
23 additions
and
8 deletions
src/plugins/server/states.ml
+
23
−
8
View file @
691d84e6
...
@@ -109,9 +109,14 @@ let synchronize model =
...
@@ -109,9 +109,14 @@ let synchronize model =
Hashtbl
.
remove
model
.
projects
(
Project
.
get_unique_name
p
)
in
Hashtbl
.
remove
model
.
projects
(
Project
.
get_unique_name
p
)
in
Project
.
register_before_remove_hook
cleanup
;
Project
.
register_before_remove_hook
cleanup
;
Project
.
register_todo_before_clear
cleanup
;
Project
.
register_todo_before_clear
cleanup
;
Request
.
on_signal
model
.
signal
(
fun
_
->
model
.
current
<-
None
;
Hashtbl
.
clear
model
.
projects
;
);
end
end
let
c
urr
ent
model
=
let
c
ont
ent
model
=
match
model
.
current
with
match
model
.
current
with
|
Some
w
->
w
|
Some
w
->
w
|
None
->
|
None
->
...
@@ -127,16 +132,26 @@ let current model =
...
@@ -127,16 +132,26 @@ let current model =
in
model
.
current
<-
Some
content
;
content
in
model
.
current
<-
Some
content
;
content
let
reload
model
=
let
reload
model
=
let
m
=
current
model
in
let
m
=
content
model
in
m
.
cleared
<-
true
;
m
.
updates
<-
Kmap
.
empty
m
.
cleared
<-
true
;
m
.
updates
<-
Kmap
.
empty
;
Request
.
emit
model
.
signal
let
update
model
k
=
let
update
model
k
=
let
m
=
current
model
in
let
m
=
content
model
in
if
not
m
.
cleared
then
m
.
updates
<-
Kmap
.
add
(
model
.
key
k
)
(
Add
k
)
m
.
updates
if
not
m
.
cleared
then
begin
m
.
updates
<-
Kmap
.
add
(
model
.
key
k
)
(
Add
k
)
m
.
updates
;
Request
.
emit
model
.
signal
;
end
let
remove
model
k
=
let
remove
model
k
=
let
m
=
current
model
in
let
m
=
content
model
in
if
not
m
.
cleared
then
m
.
updates
<-
Kmap
.
add
(
model
.
key
k
)
Remove
m
.
updates
if
not
m
.
cleared
then
begin
m
.
updates
<-
Kmap
.
add
(
model
.
key
k
)
Remove
m
.
updates
;
Request
.
emit
model
.
signal
;
end
(* -------------------------------------------------------------------------- *)
(* -------------------------------------------------------------------------- *)
(* --- Fetch Model Updates --- *)
(* --- Fetch Model Updates --- *)
...
@@ -167,7 +182,7 @@ let update_entry buffer cols key = function
...
@@ -167,7 +182,7 @@ let update_entry buffer cols key = function
|
Add
v
->
add_entry
buffer
cols
key
v
|
Add
v
->
add_entry
buffer
cols
key
v
let
fetch
model
n
=
let
fetch
model
n
=
let
m
=
c
urr
ent
model
in
let
m
=
c
ont
ent
model
in
let
reload
=
m
.
cleared
in
let
reload
=
m
.
cleared
in
let
buffer
=
{
let
buffer
=
{
reload
;
reload
;
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment