Skip to content
Projeler
Gruplar
Parçacıklar
Yardım
Yükleniyor...
Oturum aç / Kaydol
Gezinmeyi değiştir
C
core
Proje
Proje
Ayrıntılar
Etkinlik
Cycle Analytics
Depo (repository)
Depo (repository)
Dosyalar
Kayıtlar (commit)
Dallar (branch)
Etiketler
Katkıda bulunanlar
Grafik
Karşılaştır
Grafikler
Konular (issue)
0
Konular (issue)
0
Liste
Pano
Etiketler
Kilometre Taşları
Birleştirme (merge) Talepleri
0
Birleştirme (merge) Talepleri
0
CI / CD
CI / CD
İş akışları (pipeline)
İşler
Zamanlamalar
Grafikler
Paketler
Paketler
Wiki
Wiki
Parçacıklar
Parçacıklar
Üyeler
Üyeler
Collapse sidebar
Close sidebar
Etkinlik
Grafik
Grafikler
Yeni bir konu (issue) oluştur
İşler
Kayıtlar (commit)
Konu (issue) Panoları
Kenar çubuğunu aç
LibreOffice
core
Commits
bf82918e
Kaydet (Commit)
bf82918e
authored
Nis 16, 2015
tarafından
Michael Meeks
Dosyalara gözat
Seçenekler
Dosyalara Gözat
İndir
Eposta Yamaları
Sade Fark
Improve the VclPtr documentation.
Change-Id: Ie69fa0fcc8cae0a3f5be8fb4a5b884caa2d56a94
üst
35178d18
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
44 additions
and
0 deletions
+44
-0
README.lifecycle
vcl/README.lifecycle
+44
-0
No files found.
vcl/README.lifecycle
Dosyayı görüntüle @
bf82918e
...
@@ -127,6 +127,15 @@ or:
...
@@ -127,6 +127,15 @@ or:
- VirtualDevice aDev;
- VirtualDevice aDev;
+ ScopedVclPtrInstance<VirtualDevice> pDev;
+ ScopedVclPtrInstance<VirtualDevice> pDev;
Other things that are changed are these:
- pButton = new PushButton(NULL);
+ pButton = VclPtr<PushButton>::Create(nullptr);
...
- vcl::Window *pWindow = new PushButton(NULL);
+ VclPtr<vcl::Window> pWindow;
+ pWindow.reset(VclPtr<PushButton>::Create(nullptr));
** Why are these 'disposeOnce' calls in destructors ?
** Why are these 'disposeOnce' calls in destructors ?
This is an interim measure while we are migrating, such that
This is an interim measure while we are migrating, such that
...
@@ -175,6 +184,11 @@ or:
...
@@ -175,6 +184,11 @@ or:
+ shrink them - some work should incrementally
+ shrink them - some work should incrementally
migrate back to destructors.
migrate back to destructors.
* VclBuilder
+ ideally should keep a reference to pointers assigned
in 'get()' calls - to avoid needing explicit 'clear'
code in destructors.
---------- FAQ / debugging hints ----------
---------- FAQ / debugging hints ----------
** Compile with dbgutil
** Compile with dbgutil
...
@@ -209,3 +223,33 @@ or:
...
@@ -209,3 +223,33 @@ or:
=> also worth git grepping for 'new sfx::sidebar::TabBar' to
=> also worth git grepping for 'new sfx::sidebar::TabBar' to
see where those children were added.
see where those children were added.
** Check what it used to do
While a ton of effort has been put into ensuring that the new
lifecycle code is the functional equivalent of the old code,
the code was created by humans. If you identify an area where
something asserts or crashes here are a few helpful heuristics:
* Read the git log -u -- path/to/file.cxx
=> Is the order of destruction different ?
in the past many things were destructed (in reverse order of
declaration in the class) without explicit code. Some of these
may be important to do explicitly at the end of the destructor.
eg. having a 'Idle' or 'Timer' as a member, may now need an
explicit .Stop() and/or protection from running on a
disposed Window in its callback.
=> Is it 'clear' not 'disposeAndClear' ?
sometimes we get this wrong. If the code previously used to
use 'delete pFoo;' it should now read pFoo->disposeAndClear();
Conversely if it didn't delete it, it should be 'clear()' it
is by far the best to leave disposing to the VclBuilder where
possible.
In simple cases, if we allocate the widget with VclPtrInstance
or VclPtr<Foo>::Create - then we need to disposeAndClear it too.
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment