Skip to content

add menu:create_page(page_size, page_no)#293

Open
shewer wants to merge 3 commits intohchunhui:masterfrom
shewer:patch-14
Open

add menu:create_page(page_size, page_no)#293
shewer wants to merge 3 commits intohchunhui:masterfrom
shewer:patch-14

Conversation

@shewer
Copy link
Contributor

@shewer shewer commented Dec 8, 2023

CandidateList menu:create_page(page_size, page_no)

local seg =  ctx.composition:back()
local cands = seg and seg.menu 
     and seg.menu:create_page(5,0)
cands = cands or {}
for _, cand in ipairs(cands) do print(cand.text) end

CandidateList menu:create_page(page_size, page_no) 
```lua
local seg =  ctx.composition:back()
local cands = seg and seg.menu 
     and seg.menu:create(5,0)
cands = cands or {}
for _, cand in ipairs(cands) do print(cand.text) end
```
src/types.cc Outdated

CandidateList create_page(T& t, size_t page_size, size_t page_no) {
if (auto p = an<Page>( t.CreatePage(page_size, page_no)) ) {
return p->candidates;
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

返回了一个局部 shared_ptr 的成员,可能要论证一下是否有内存方面的问题

改回原式  井  手動刪除 Paeg 記憶體
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants