add note about QLET (important to remember)

This commit is contained in:
polos 2020-09-24 08:44:42 +02:00
parent 40511818ef
commit c52c34de6c

View file

@ -9,6 +9,25 @@
;;; (server-request "booking.py"
;;; (list (cons "from" "2020-08-01")
;;; (cons "to" "2020-08-08")))
;;;
;;; please note the use of QLET to have all locally created Qt objects deleted
;;; when leaving the function body;
;;;
;;; note also how this is done with function HTTP-PART, where we can't use QLET
;;; inside the function for 'QHttpPart', because we need to return the newly
;;; created Qt object; in this case, QLET is placed in the caller, see:
;;;
;;; (dolist...
;;; (qlet ((part (http-part param)))
;;; (|append|...
;;;
;;; ...and since we are at it, just a reminder:
;;;
;;; as you already should know, QLET is crucial for all only locally used Qt
;;; objects, because it guarantees two things:
;;; - the C++ destructors being called when leaving the QLET body
;;; - not leaving around some garbage (GC through finalizing is only implemen-
;;; ted for return values from Qt function calls)
(qrequire :network)